Why can you remove the gravitational constant from a computer game simulation?


$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.


Related videos on Youtube

Marcus Booster
Author by

Marcus Booster

Updated on February 02, 2020


  • Marcus Booster
    Marcus Booster almost 3 years

    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?

    • valdo
      valdo over 11 years
      In simple words: force and distance in games are usually measured in chickens and ducks.
    • Vladimir Kalitvianski
      Vladimir Kalitvianski over 11 years
      Gravity is not "removed" there in the sense that attraction is still there.
  • Marcus Booster
    Marcus Booster over 11 years
    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.
  • JollyJoker
    JollyJoker over 11 years
    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.
  • Stan Liou
    Stan Liou over 11 years
    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.