1
$\begingroup$

I am using NASA EPIC api to fetch daily earth imagery. Along with the images it also gives certain data regarding the position of certain bodies like sun, earth, moon and satellite itself. These coordinates are in j2000 standard. How can I calculate the distance between earth and sun using these coordinates ?

Example coordinates include : "centroid_coordinates":{"lat":24.56543,"lon":170.683594} "dscovr_j2000_position":{"x":339005.145834,"y":1368757.776568,"z":645861.927788} "lunar_j2000_position":{"x":381104.35964,"y":104675.95663,"z":-35701.90868} "sun_j2000_position":{"x":56531896.481815,"y":129098775.627199,"z":55963516.666649}

You can get the complete data here : NASA EPIC api

$\endgroup$

1 Answer 1

2
$\begingroup$

It looks like the sun_j2000_position is the Sun's position relative to Earth. So it is as simple as using the Pythagorean theorem: $ \sqrt{x^2+y^2+z^2} $ for those coordinates, which yeild about 151,000,000 kilometers.

$\endgroup$
1
  • $\begingroup$ thankyou very much. It works! $\endgroup$ Jul 12 at 9: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.