Distance from Earth to other solar system bodies. #361
-
Have just discovered this library of routines and it is exactly what I have been looking for, very impressive work indeed. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @Tichro and welcome to the project! You can use the Vector vec = Astronomy.geoVector(Body.Jupiter, time, Aberration.Corrected);
double dist = vec.length(); |
Beta Was this translation helpful? Give feedback.
Hi @Tichro and welcome to the project! You can use the
geoVector
function to calculate a 3D vector from the center of the Earth to the center of a planet, the Sun, or the Moon. Then you can use thelength
member function to find the distance expressed in astronomical units: