I am trying to find out if a planet is in an apparent retrograde motion with respect to the earth at any given point in time. Given the time in Julian days.

I already have the geocentric and heliocentric coordinates and velocities of the planet using the JPL ephemeris, but not sure of what mathematical formula to use to identify the retrograde motion.

I read this article "https://physics.stackexchange.com/questions/249493/mathematically-calculate-if-a-planet-is-in-retrograde" which had a similar question but I am not sure of:

  1. Is the answer correct as it has not been marked as correct?
  2. How to represent earth in the XY plane only when it has XYZ planes and why do we even need to do that? Can't we just use the heliocentric equatorial plane which I think is the same as the one used by NASA JPL ephemeris.
  • $\begingroup$ This is a really interesting question, and it needs a clear definition of "retrograde motion". I think motion where Right Ascension (RA) decreases is the standard. So you need the position of the planet with respect to the earth, projected on to the celestial sphere. It's a little complicated if neither orbit is exactly in the plane of the ecliptic. The answer in physics stack exchange doesn't give enough to actually get what you need. $\endgroup$
    – uhoh
    Oct 22 '16 at 2:13
  • $\begingroup$ If you have the planets dx, dy, and dz with respect to Earth, this would just be when dy is negative. However, depending on what you have and the level of precision you require, the problem might be more difficult. I assume you know you can find this information online and are just interested in calculating it yourself for fun. Feel free to google talk me at carter.barry@gmail.com for help- I do stuff like this for fun too. $\endgroup$
    – user21
    Oct 22 '16 at 17:18
  • $\begingroup$ @barrycarter I tried to do using both the approaches the one mentioned by you to look for dy and also tried the one suggested by Mark in the post for which I added the url were he suggested d (tanarc(dy,dx))/dt . Even though I see trend reversals happening in both the approaches but the dy change is not that accurate and happens few days earlier than what is suggested by the almanac, the other approach gives a more close answer $\endgroup$
    – ADUser
    Oct 22 '16 at 21:26
  • $\begingroup$ @barrycarter what coordinate system is that?? I think RA is the proper place to define retrograde and prograde. dy can increase or decrease for retrograde depending on which side of the sun you are talking about. But I agree that migration is a good idea, the apparent retrograde motion of a planet really is more "Astronomy" than "Space Exploration". $\endgroup$
    – uhoh
    Oct 23 '16 at 6:43
  • $\begingroup$ @uhoh I have no idea what I was thinking when I wrote that. The correct way is to of course look at the change n the angle, as ADUser notes. $\endgroup$
    – user21
    Oct 23 '16 at 18:14

Here is a quick answer. Apparent retrograde motion of a planet as seen from Earth means that its ecliptic longitude is decreasing. (Thanks to @barrycarter for correcting my previous statement.) You have to calculate the apparent angular position of the planet from the Earth in ecliptic coordinates (as explained here and here) and find places where the ecliptic longitude is decreasing.

You can subtract the positions of Earth from the position of the planet in either coordinates. Then you express that vector in spherical coordinates. It doesn't matter if it's heliocentric or geocentric. What matters is the direction that the axes of the coordinate system is pointing, not where the center is.

If you want RA and dec, use ICRF coordinates, and these can be transformed to ecliptic coordinates as well. An easy way to do this is to use the python package Skyfield.

Here's a sample script and a plot. This is Mars from 2010.0 to 2020.0 and the thick red line represents retrograde motion.

enter image description here

import numpy as np
import matplotlib.pyplot as plt

from skyfield.api import load

planets = load('de421.bsp')

earth   = planets['earth']
mars    = planets['mars']

year_zero = 2010
days = np.linspace(1, 3650, 10000)
years = year_zero + days / 365.2564
ts = load.timescale()
t = ts.utc(year_zero, 1, days)

# thanks to @barrycarter's comment, do it the right way!
eclat, eclon, ecd = earth.at(t).observe(mars).ecliptic_latlon()

eclondgs      = (180./np.pi) * eclon.radians
eclondel      = eclondgs[1:] - eclondgs[:-1]

eclondel[eclondel < -300] += 360. # this is a fudge for now
eclondel[eclondel > +300] -= 360. # this is a fudge for now

prograde   = eclondel > 0.

eclon_prograde   = eclondgs.copy()[:-1]
eclon_retrograde = eclondgs.copy()[:-1]

eclon_prograde[~prograde]  = np.nan
eclon_retrograde[prograde] = np.nan

plt.plot(years[:-1], eclon_prograde,   '-g', linewidth=1)
plt.plot(years[:-1], eclon_retrograde, '-r', linewidth=3)
plt.ylim(0, 360)
plt.title('Mars Ecliptic longitude (degrees) AD 2010.0 to 2020.0',
  • $\begingroup$ I actually think retrograde means the ecliptic longitude is decreasing, but that's just me being nitpicky :) $\endgroup$
    – user21
    Oct 23 '16 at 18:17
  • $\begingroup$ @barrycarter You are right and it's not nitpicking at all. Good catch - thanks! After face-palming I fixed the text and python. For the math I just changed .radec()to `.ecliptic_latlon(), renaming the variables and fixing the text took longer. $\endgroup$
    – uhoh
    Oct 23 '16 at 23:28
  • $\begingroup$ @CarlWitthoft thanks! I guess I've "settled" for something that's easy enough even I can use it. And there's all those darn python packages... $\endgroup$
    – uhoh
    Oct 24 '16 at 12:55
  • $\begingroup$ @LouisMaddox thanks for the edit! In 2016 I started with Python 2, so there's going to be other issues like this with older scripts here; please feel free to fix anything you find. Welcome to Astronomy SE! $\endgroup$
    – uhoh
    Sep 17 at 0:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy