Physics Examples/Help With Differentials
I found a website (http://www.myphysicslab.com) that shows examples of 2D physics systems for a number of objects like springs and rigid bodies. It also explains things with some equations.
I'm currently trying to reproduce the single spring in my program (just learning some physics) but I am a bit rusty on differentials. I took very little calculus so I'm not very good with figuring out some of the things.
When it says
x'' = k/m*x  b/m*x'
is that the same as
a = k/m*x  b/m*v?
If so could I handle the position as follows (I intialized x = 4 and v = 0)?
Thanks for any help.
I'm currently trying to reproduce the single spring in my program (just learning some physics) but I am a bit rusty on differentials. I took very little calculus so I'm not very good with figuring out some of the things.
When it says
x'' = k/m*x  b/m*x'
is that the same as
a = k/m*x  b/m*v?
If so could I handle the position as follows (I intialized x = 4 and v = 0)?
Code:
float m = .5; //mass
float R = 2.5; //length of spring at rest
float k = 3; //spring stiffness
float b = .1; //damping constant
float a = (k/m) * x  (b/m) * v;
v += a;
x += v;
Thanks for any help.
Nick Wrote:When it saysIf x is the position function then yes, x'' would be acceleration.
x'' = k/m*x  b/m*x'
is that the same as
a = k/m*x  b/m*v?
Possibly Related Threads...
Thread:  Author  Replies:  Views:  Last Post  
Porting examples from an introductory 3D book  crazy_ut2k4  4  4,571 
Feb 16, 2007 08:04 AM Last Post: AnotherJake 

Bullet Physics Library / COLLADA physics viewer  erwincoumans  14  18,122 
Aug 12, 2006 12:59 AM Last Post: Fenris 

NSAffineTransform Examples  dancedrummer  2  7,402 
Jul 1, 2005 09:34 PM Last Post: dancedrummer 