HP Prime Forum

Full Version: precision ephemeris of the sun
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This HP Prime program demonstrates how to call a subroutine named sun2 which computes a precision ephemeris of the sun.

Here is the syntax for the routine

EXPORT sun2(jdate)

// precision ephemeris of the Sun

// input

// jdate = julian ephemeris date

// output

// rsun(1) = x-component of the eci position vector of the Sun (km)
// rsun(2) = y-component of the eci position vector of the Sun (km)
// rsun(3) = z-component of the eci position vector of the Sun (km)
// rsun(4) = right ascension of the Sun (radians)
// (0 <= rasc <= 2 pi)
// rsun(5) = declination of the Sun (radians)
// (-pi/2 <= decl <= pi/2)
// note

// coordinates are inertial, geocentric,
// equatorial and true-of-date

// reference

// Planetary Programs and Tables
// by Pierre Bretagnon & Jean-Louis Simon

and here is the screen display generated by the demo program.


rsun_x = 128426556.337 km
rsun_y = 71703229.3293 km
rsun_z = 31080388.5969 km

rmag = 150335371.833 km

right ascension = 29.1755355809 deg

declination = 11.9313969567 deg

A PDF document included with the attached zip file has details of the algorithm.
Reference URL's