Questions tagged [physics]

Refers to real-world physics. For simulation of physics in games use the [game-physics] tag instead, for questions using an existing physics engine use [physics-engine]. Physics is a science that studies the interactions of energy and matter. Questions with this tag concern the simulation or implementation of real-world physics concepts in programming.

The physics tag should be used for questions about how physics can be simulated or implemented in programming. Please ask questions about physics in a non-programming context on the Physics site. Also consider that questions specific to a simplified or approximate physics engine for use in games might receive better answers if asked on Game Development.

3476 questions
1
vote
1 answer

Spring physics equilibrium always moving to left

I have the following mesh which is generated by random points and creating triangles using Delaunay triangulation. Then I apply spring force per triangle on each of its vertices. But for some reason the equilibrium is always shifted to the…
ArmenB
  • 2,125
  • 3
  • 23
  • 47
1
vote
1 answer

Quaternion Interpolation w/ Rate Matching

I have an object w/ and orientation and the rotational rates about each of the body axis. I need to find a smooth transition from this state to a second state with a different set of rates. Additionally, I have constraints on how fast I can…
fbl
  • 2,840
  • 3
  • 33
  • 41
1
vote
1 answer

Wave Packet Fourier Algorithm in Java

I am looking to create a program in Java that can use symbolic, as well as numerical, data in a Fourier Transform in order to combine various sinusoidal wave functions into a single wave packet, i.e. changing a position wave function into a momentum…
B. Klein
  • 45
  • 2
  • 8
1
vote
0 answers

How to make simulated electric components behave nicely?

I'm making a simple electric circuit simulator. It will (at least initially) only feature batteries, wires and resistors in series and parallel. However, I'm at a loss how best to simulate said circuit in a good way. Specifically, I will have…
Arthur
  • 653
  • 2
  • 6
  • 21
1
vote
0 answers

Is there any basic JavaScript inverse kinematic script?

Is there anything better than what I have now? The solving on the angle's constraint is getting tedious. This was originally AS3: http://www.lorenzonuvoletta.com/wp-content/uploads/others/Main.as The angle of freedom are constrained by an in and…
1
vote
2 answers

How to accomplish pendulum effect using the accelerometer in an iOS App

By no means I am a physics expert. I am writing an iOS (iPad to be precise) App which will present a door knob sign, hanging off a (surprise) door knob. What I need to accomplish is to simulate a pendulum effect on the sign whenever the device gets…
boliva
  • 5,604
  • 6
  • 37
  • 39
1
vote
1 answer

Car crash simulation

I want to ask you How can I make simulation of car crash ? On the internet I found http://www.gamedev.net/reference/articles/article1459.asp . I think about using finite-element-method, but now I think it is too difficult for me :/ Do you know any…
sim89
  • 11
  • 2
1
vote
0 answers

Collision Resolution between a circle and a rectangle

Can anyone please help me out with this collision resolution process? I am colliding a circle with a rectangle and can detect the collision. However, I am at a loss to understand how to resolve the velocities of the two for a general case. In my…
Souparno Paul
  • 17
  • 1
  • 6
1
vote
1 answer

Using finite difference in python

I am trying to use Python with Numpy to solve a basic equation using the finite difference method. The code gives me the correct first value for a i.e it gives me a[1]; however, every other value after that is just zero? I don't know what I'm doing…
rcss92
  • 13
  • 3
1
vote
1 answer

Optional unwrapping SKPhysics error

Before I'm crucified with downvotes let me say I have done research into this and I still cannot understand why I am getting this error. I have a core that the player is trying to defend and you can shoot little lasers out from it to defend against…
1
vote
0 answers

How do I create a interactive canvas basic geometric shapes

I am currently on spring break and since I only work 25 hours a week I have too much free time on my hands. I am a Computer Science student and I decided to spend my free time improving my coding skills and my understanding of electromagnetic…
spstephens
  • 75
  • 1
  • 7
1
vote
1 answer

Why do I get inaccuracies when working with large scale/speed projectiles, is it due to Eulerian Integration?

So I am trying to make a Physics Simulation, which aims to simulate a missile going off a long distance away, (for my example I have used 1.6km) and I have a AA weapon at this 1.6km distance; when the missile is launched, due to maths I have worked…
1
vote
0 answers

Box2d javascript revolute joint same anchor point different bodies

I'm trying to make a rag doll and I have 2 hip joints implemented as revolute joints. The problem is that they are not responding as independent segments. It seems like one of them is holding up the other one. It looks like this: If I take out one…
terminix00
  • 327
  • 2
  • 13
1
vote
1 answer

How to make SKSpriteNode fall at a downward curve

What I have Now: The node currently only travels in a straight line on the x-axis. let actionBomb = SKAction.repeatForever(SKAction.moveTo(x: 495, duration: 3.0)) What I’m looking to achieve: The goal is to have the node travel at a downward…
P.Dane
  • 91
  • 8
1
vote
1 answer

Computing the result of an integral in Swift

I need to create a script that will calculate the overlap orbital of two 1s orbitals. The integral is given by I tried calculating this using code but my answer is nowhere near the analytic result of S=(1+R+R^2/3)exp(-R). Could someone help me…
loltospoon
  • 239
  • 1
  • 9