Skip to content

Commit 05a46df

Browse files
committed
Fixes sign of PlAng in ephems (negated for retrograde orbits).
The Horizons commentary for this quantity specifies that it is positive if the observer is above the orbit plane and negative if below. That means the quantity must flip sign for a retrograde orbit. Odd, but easy to accommodate. Man-To Hui pointed out the error, and also noticed that even after this fix, PlAng for C/2024 S1 (Kreutz sungrazer) differs from Horizons by as much as three degrees. Still investigating this.
1 parent 2e75947 commit 05a46df

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ephem0.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -3372,12 +3372,16 @@ static int _ephemeris_in_a_file( const char *filename, const double *orbit,
33723372
{
33733373
double orbit_norm[3], unused_pa, dist;
33743374
DPT orbit_pole;
3375+
bool is_retrograde;
33753376

33763377
vector_cross_product( orbit_norm, orbi, orbi + 3);
3378+
is_retrograde = (orbit_norm[2] < 0.);
33773379
ecliptic_to_equatorial( orbit_norm);
33783380
vector_to_polar( &orbit_pole.x, &orbit_pole.y, orbit_norm);
33793381
calc_dist_and_posn_ang( &ra_dec.x, &orbit_pole.x,
33803382
&dist, &unused_pa);
3383+
if( is_retrograde) /* odd convention : PlAng is +ive if */
3384+
dist = PI - dist; /* observer is 'above' the orbit plane */
33813385
snprintf_append( tbuff, sizeof( buff), " %7.3f",
33823386
dist * 180. / PI - 90.);
33833387
}

0 commit comments

Comments
 (0)