# Converting the Gravitational Constant [closed]

Hello all and thank you for reading.

I am creating a program in Unity where I recreate the earth-moon orbit. Unity struggles with numbers so large when I write code in meters and kilograms so I made my own units. 1 unit of mass = the earth's mass (5.9736f*10^24 kg). 1 unit of length is the Earth's Diameter (12,756,000m) and the distance between the earth and the moon at a supermoon is 28.222 units of length (360,000,000m). In this world, what is the gravitational constant? I have done the math in two ways and gotten answers orders of magnitude different. I am officially giving up and asking for help from the internet.

Any help is really appreciated and please show work, I am dying to know how this is done.

• You need to specify an appropriate unit of time as well. Apr 20, 2020 at 4:16
• I was afraid someone would say this. Can I assume the framerate of the game is equal to a second? Apr 20, 2020 at 4:19
• It takes a month for the Moon to go around the Earth. Do you want the player to have to play for a month to see one orbit? If not, “game time” can’t be “orbit time”. But you can certainly update the screen once per second, if you want a jerky game. Apr 20, 2020 at 4:22
• If you want a value of $G$ that isn’t too big or small, you need to pick a unit of time like a day or a month. Apr 20, 2020 at 4:24
• Agreed. I am new to unity as well as physics. This issue is on my radar, but I wanted to get the question above squared away first. If you have Unity experience, I'd love some guidance on accelerating time. Apr 20, 2020 at 4:25

The SI value of the gravitational constant is

$$G=6.674\times 10^{-11}\frac{\text{meter}^3}{\text{kilogram}\,\text{second}^2}.$$

Define your new units (with the time unit taken from your comment):

$$1\text{ MyLengthUnit}=1.2756\times 10^7\text{ meters};$$

$$1\text{ MyMassUnit}=5.9736\times 10^{24}\text{ kilograms};$$

$$1\text{ MyTimeUnit}=13.5\text{ days}=1.1664\times 10^6\text{ seconds}.$$

Then in terms of your units, the SI units are

$$1\text{ meter}=\frac{1}{1.2756\times 10^7}\text{ MyLengthUnit};$$

$$1\text{ kilogram}=\frac{1}{5.9736\times 10^{24}}\text{ MyMassUnit};$$

$$1\text{ second}=\frac{1}{1.1664\times 10^6}\text{ MyTimeUnit}.$$

This means that

\begin{align} G&=6.674\times 10^{-11}\frac{\left(\frac{1}{1.2756\times 10^7}\text{ MyLengthUnit}\right)^3}{\left(\frac{1}{5.9736\times 10^{24}}\text{ MyMassUnit}\right)\left(\frac{1}{1.1664\times 10^6}\text{ MyTimeUnit}\right)^2}\\ &=\frac{(6.674\times 10^{-11})(5.9736\times 10^{24})(1.1664\times 10^6)^2}{(1.2756\times 10^7)^3}\frac{\text{MyLengthUnit}^3}{\text{MyMassUnit}\,\text{MyTimeUnit}^2}\\ &=261321\frac{\text{MyLengthUnit}^3}{\text{MyMassUnit}\,\text{MyTimeUnit}^2}. \end{align}

(I kept a few too many (in)significant digits in the final integral value.)

• This works perfectly. Thank you so much! Apr 20, 2020 at 17:13