F = m*g - Question...

Started by
2 comments, last by bnpla 18 years ago
how can i know if i have a shape, that have XX weight, how much force i must passed to move it? i mean, how i traslate the F = m*g to x,y coordinates in the screen? So i can know if an obect is 50 Kg, ad the user insert the force it will give to th obect in order to move it, how much pixels i shoul move it, and how long?
Advertisement
F = m * a

What that means is that force = mass times acceleration. Under gravity, acceleration is g, or 9.8 m/s^2 downward, so your equation F = m*g is the special case for the force of gravity.

An acceleration (provided by a force) doesn't just 'move' a block a certain distance; it changes the speed of the block. If you have a constant force downward, the object's speed in the vertical direction will keep on getting lower and lower.

You can think of the acceleration as how fast the velocity changes, just like the velocity is how fast the position changes. (I think physics is a lot easier to understand using calculus, but maybe that's just me.)

Think of throwing a ball straight up. The speed starts out positive, as the ball rises. However, the force from gravity is constantly pulling down on the ball. The speed keeps on decreasing until the ball is no longer moving at the top, and the speed keeps on decreasing as the ball then starts to fall faster and faster.

You can do the same thing separately in each direction, x, y, and z. That will give you the full 3d motion.

Of course, in real life, there are many forces, some much more complicated to calculate than gravity (air resistance, friction, the normal force, electric forces, and lots more).

If you're interested in writing a game that heavily involves physics, I'd suggest taking a class in physics.
F = m*a
a = F/m

assuming F is constant, then a is also constant while F is applied.

s = s0 + v0*t + 1/2*a*t*t
v = v0 + a*t

where
v0 - initial speed
s0 - initial position
t - time from the moment where v0 and s0 are grounded till the moment you want to calculate position for.

This works for either linear, two dimensional and three dimensional movement - the elements v, v0, s, s0, a and F will just be scalars, two dimensional vectors/points or three dimensional vectors/points.

Basically, for a frame where you know a force F is being applied during a time t, you can calculate what the change in speed will be (which you'll need for the next time you want to calculate the position, since it'll become the next v0), and what the new position will be with those formulas.


As an aside (which you don't need to know or care :)), these formulas are basically integrals in order to time of a, for a constant a. a is the rate at which v changes; so a is the derived of v in order to time, and conversely v is the integral of a in order to time. speed is the change of position in time, so speed is the derived of the position, and conversely position is the integral of speed.

Edit - I've create a VB 2005 sample that shows using these equations - get the zip here (full solution)


[Edited by - alexmoura on May 13, 2006 12:12:39 AM]
Quote:Original post by alexmoura
F = m*a
a = F/m

assuming F is constant, then a is also constant while F is applied.

s = s0 + v0*t + 1/2*a*t*t
v = v0 + a*t

where
v0 - initial speed
s0 - initial position
t - time from the moment where v0 and s0 are grounded till the moment you want to calculate position for.

This works for eithe [ ... ]


Thanks, thats exactly what iwant to know, this expecialy -> a = F/m and replace that in the equations. Thanks!

This topic is closed to new replies.

Advertisement