I've seen in a few gravity simulation games (ie. bouncing balls) the equation:

force = G * m1 * m2 / distance^2

shortened to this by removing the gravitational constant:

force = m1 * m2 / distance^2

I accept that it works fine and saves some calculations, but I'm wondering why it still works? Is the value just too small to matter? What's the physics behind this?

  • 8
    $\begingroup$ In simple words: force and distance in games are usually measured in chickens and ducks. $\endgroup$
    – valdo
    Sep 5 '11 at 10:56
  • $\begingroup$ Gravity is not "removed" there in the sense that attraction is still there. $\endgroup$ Sep 5 '11 at 17:46

$G$ is just a constant of proportionality to get the units right (so that when $m_1$ and $m_2$ are in kilograms and $r$ is in meters you get a force in Newtons rather than wingdingalings or something really weird). Indeed cosmologists like to work in a system of units where $G = c = 1 \text{ (dimensionless)}$, and particle physicists like to work in units where $c = \hbar = 1 \text{ (dimensionless)}$, you can even set all three of these numbers to 1 if you like.

In your game implementation you have broad freedom to choose the scale of the masses and the time intervals over which to evaluate stuff, so obviously you can ditch the constant if you want to. Now, if you want to model the solar system and to use the masses you find in a table for the planets and the sun, you'll have to include the constant.

This has nothing to do with the size of the constant however, because it is a multiplicative coefficient.

  • $\begingroup$ Thanks. Would you say that G is used to normalize the equation to fit a particular implementation (cosmology, particle physics, etc.)? And since I'm working in my own game implementation, it's just 1, so I can leave it out? Sorry I'm speaking as like a programmer, it's my only frame of reference. $\endgroup$ Sep 5 '11 at 14:07
  • 3
    $\begingroup$ Yes. It's just there because meters, kilograms and seconds have their own historical reasons for being as large they are.If you write a game, you don't have to care about such things. You obviously need to think about how strong gravity should be in your game, but you can tweak the masses to do that. If you want the strength of gravity to change dynamically in the game (say, become stronger over time) you could keep it as a variable, but there's no need for it as a constant. $\endgroup$
    – JollyJoker
    Sep 5 '11 at 15:12
  • 2
    $\begingroup$ A very similar situation occurs in electrostatics: in SI units, Coulomb's law is $F = (1/4\pi\epsilon_0)(q_1q_2/r^2)$; the funky constant is there because the unit charge (coulomb) is defined in a roundabout way using magnetic force in current-carrying wires. But in Gaussian units, it is $F = q_1q_2/r^2$, with no constant, because the unit charge (esu) is defined in terms of Coulomb's law instead. Look up "geometrized units" on wikipedia for an extreme version of this. $\endgroup$
    – Stan Liou
    Sep 5 '11 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.