View/Copy PHP Source Code 

VSOP87C Sun Module Example / Test Demo

This simple example/test program computes the basic astronomical
statistics for the Sun at 00h TDB on any given date according to the
The VSOP87 C series.

NOTES:
  • This demo version automatically adjusts for Julian or Gregorian
    calendar dates.

  • Dates up to 1582 Oct 04 = Julian Calendar Dates.

  • Dates from 1582 Oct 15 onwards = Gregorian Calendar Dates.

  • BC years are represented here by using negative year values.
    However, there is no calendar year 0 (zero), by definition.


Enter Numerical Calendar Date Elements  (yNum  mNum  dNum)

Initial default startup date = Current date (2025 09 19) at 00:00:00 TT.

The program does not check for errors and simply assumes the calendar
date elements (yNum, mNum, dNum) are valid values.
Valid date elements should return a valid result.

If possible, check the test computations against another VSOP87 C
source to see how closely they match.

EXAMPLE:
October 5th, 1991 date elements would be entered as:   1991 10 05


------------------------------------------------------
VSOP87C Geocentric Astronomical Statistics For the Sun

For Ecliptic and Equinox of Date

yyyy mm dd  =  2025 09 19
JDate  00h  =  2460937.5

------------------------------------
Statistics returned by the function:

VSOP87C_Geocentric_Sun (JDTT)

RAHrs      = 11.774833314305 = Equatorial RA of the Sun in hours
DeclDeg    = 1.4631812675725 = Equatorial declination of the Sun in degrees
DistAU     = 1.0046611507692 = True Earth/Sun distance in AUs
AngDiamDeg = 0.53065977611508 = Angular diameter of the Sun in degrees
EclLngDeg  = 176.31952080687 = Ecliptical longitude of the sun in degrees
EclLatDeg  = 6.513109538112E-5 = Ecliptical latitude of the sun in degrees