Learn R Programming

astrolibR (version 0.1)

xyz: Calculate geocentric X,Y, and Z and velocity coordinates of the Sun

Description

Calculate geocentric X,Y, and Z and velocity coordinates of the Sun

Usage

xyz(date, equinox)

Arguments

date
reduced julian date (=JD - 2400000), scalar or vector
equinox
equinox of output (default = 1950)

Value

x,y,z
geocentric rectangular coordinates, in Astronomical Units, scalar or vector
xvel,yvel,zvel
velocity vectors corresponding to X, Y and Z

Details

Calculates geocentric X,Y, and Z vectors and velocity coordinates (dx, dy and dz) of the Sun. The positive X axis is directed towards the equinox, the y-axis is directed towards the point on the equator at right ascension 6h, and the z axis is directed toward the north pole of the equator. Typical position accuracy is <1e-4 au="" (15000="" km).<="" p="">

The Earth-Sun distance is given by sqrt(x^2 + y^2 + z^2) for the given date. Note that velocities in the Astronomical Almanac are for Earth/Moon barycenter (a very minor offset); see AA 1999 page E3.

References

Original algorithm from Almanac for Computers, Doggett et al. USNO 1978 Adapted from the book Astronomical Photometry by A. Henden

Examples

Run this code
	
#   What were the rectangular coordinates of the Sun on 
#  Jan 22, 1999 0h UT (= JD 2451200.5) in J2000 coords? 
#  NOTE: Astronomical Almanac (AA) is in TDT, so add 64 seconds to UT to convert.

xyz(51200.5+64./86400, equinox=2000)

#   Compare to Astronomical Almanac (1999 page C20)
#              X  (AU)        Y  (AU)     Z (AU)
#  XYZ:      0.51456871   -0.76963263  -0.33376880
#  AA:       0.51453130   -0.7697110   -0.3337152
#  abs(err): 0.00003739    0.00007839   0.00005360
#  abs(err)
#      (km):   5609          11759         8040 

Run the code above in your browser using DataLab