Gravity

BlitzMax Forums/BlitzMax Programming/Gravity

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

g = GM/(r*r)

Where g is the acceleration due to gravity, M is the mass of the Earth, r is the distance from the centre of the Earth and G is a constant (6.67e-11 if g is in m/s^2, M in kg, r in metres, but it's one of those things you need to fiddle until it looks right in a game. Start with G=1 and scale accordingly).

g=9.81 when r is the distance from the centre of the Earth to the surface.

This equation doesn't hold if you're actually some way under the Earth's surface (because the Earth above you starts to pull you in the opposite direction to the centre)