mivion / ephemeris

Pure javascript implementation of ephemeris calculations for sun, planets, comets, asteroids and stars.
148 stars 66 forks source link

retrograde planets? #14

Open cptolemy opened 6 years ago

cptolemy commented 6 years ago

Hi

I was wondering: if we know the geocentric coordinates of the sun and one planet (longitude and distance) in one instant only, can we calculate/know mathematically if the planet is in retrograde motion or not? Or must we have 2 observations?

Clear skies

mivion commented 6 years ago

Hi,

To determine retrograde you have to calculate second position in future. For example + 1 hour or a day. Then compare with current position.

0xStarcat commented 4 years ago

Hey @cptolemy ! For what its worth, my fork of this repo just implemented retrograde planet and shadow phase calculations into version 1.2.0 https://github.com/0xStarcat/Moshier-Ephemeris-JS/tree/master

Not sure if I'll be able to get it merged here, but feel free to have a look at how I did it in the files motion.js and HeliocentricOrbitalBody.js

To answer your question, yes you need 2 observations - my fork compares the apparentLongitude of the body now, and the body 1 second from now, and if the difference is <= 0, I designate it retrograde in the results.