Converting mass #205
-
Hi and thank you for an awesome library! I can't get my head around how to convert mass from kg to the unit that's in use in this library (trying to calculate gravity between a spaceship and planets). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
If you are trying to calculate the trajectory of a spacecraft in the Solar System, chances are you can treat the spacecraft's mass as negligible (it has no measurable effect on the planet). Then all you need to know is the acceleration experienced by the spacecraft due to the Sun and planets. Internally, I do this same thing to calculate Pluto's orbit: I treat Pluto as an insignificant mass that is accelerated by the Sun and the major planets (Jupiter, Saturn, Uranus, and Neptune). The mass units I use (as returned by the If you really need the masses of solar system bodies in kg, you can multiply the return value of the Does this help, or are you looking for something else? |
Beta Was this translation helpful? Give feedback.
-
Thank you for helping me out! 🙏 Got physics and conversions working now and released alpha version of my free 2D space flight simulator: https://flanets.io zoom out and you'll see all planets in the right place and spaceship gravity physics playing nicely with astronomy.js 👌 |
Beta Was this translation helpful? Give feedback.
If you are trying to calculate the trajectory of a spacecraft in the Solar System, chances are you can treat the spacecraft's mass as negligible (it has no measurable effect on the planet). Then all you need to know is the acceleration experienced by the spacecraft due to the Sun and planets. Internally, I do this same thing to calculate Pluto's orbit: I treat Pluto as an insignificant mass that is accelerated by the Sun and the major planets (Jupiter, Saturn, Uranus, and Neptune).
The mass units I use (as returned by the
MassProduct
functions) are the product of the universal gravitation constant G with the mass of the Sun or planet M. The product GM is known much more accurately than G …