oce (version 1.2-0)

sunDeclinationRightAscension: Sun Declination and Right Ascension

Description

The formulae are from Meeus (1991), chapter 24 (which uses chapter 21).

Usage

sunDeclinationRightAscension(time, apparent = FALSE)

Arguments

time

a POSIXct time. This ought to be in UTC timezone; if not, the behaviour of this function is unlikely to be correct.

apparent

logical value indicating whether to return the 'apparent' angles.

Value

A list containing declination and rightAscension, in degrees.

References

  1. Meeus, Jean H. Astronomical Algorithms. Second edition. Willmann-Bell, Incorporated, 1991.

See Also

Other things related to astronomy: eclipticalToEquatorial(), equatorialToLocalHorizontal(), julianCenturyAnomaly(), julianDay(), moonAngle(), siderealTime(), sunAngle()

Examples

Run this code
# NOT RUN {
## Example 24.a in Meeus (1991) (page 158 PDF, 153 print)
time <- as.POSIXct("1992-10-13 00:00:00", tz="UTC")
a <- sunDeclinationRightAscension(time, apparent=TRUE)
expect_equal(a$declination, -7.78507,
             tol=            0.00004, scale=1)
expect_equal(a$rightAscension, -161.61919,
             tol=                 0.00003, scale=1)
b <- sunDeclinationRightAscension(time)
## check against previous results, to protect aginst code-drift errors
expect_equal(b$declination, -7.785464443,
             tol=            0.000000001, scale=1)
expect_equal(b$rightAscension, -161.6183305,
             tol=                 0.0000001, scale=1)

# }

Run the code above in your browser using DataCamp Workspace