Documentation ¶
Index ¶
Constants ¶
const GregorianMeanYear = 365.2425
GregorianMeanYear is the average number of calendar days in a Gregorian calendar year in the repeating 400 year Gregorian period.
The total number of calendar days in a Gregorian repeating period is (400*365) + (400/4) - (400/100) + (400/400) = 146097. Now divide by the number of calendar years in that period (400) to get 365.2425.
const GregorianRep = 146097
GregorianRep is the smallest number of calendar days that may be added to any date in the Gregorian calendar such that the day of the week, day, and month of the resulting date will be the same as the original.
GregorianRep is the smallest natural number which can be obtained by multiplying the Gregorian mean year by any natural number, and it is also exactly divisible by 7. See https://play.golang.org/p/A93sPYHxEO9.
const JulianMeanYear = 365.25
JulianMeanYear is the average number of calendar days in a Julian calendar year in the repeating 28 year Julian period.
The total number of calendar days in a Julian repeating period is (28*365) + (28/4) = 10227. Now divide by the number of calendar years in that period (28) to get 365.25.
const JulianRep = 10227
JulianRep is the smallest number of calendar days that may be added to any date in the Julian calendar such that the day of the week, day, and month of the resulting date will be the same as the original.
JulianRep is the smallest natural number exactly divisible by seven which can be obtained by multiplying the Julian mean year by any natural number. See https://play.golang.org/p/J6nsOrY_o2W.
Variables ¶
var J2000 = JD{JDN: JDN(2451545), Fraction: 0}
J2000 is Julian Date 2451545.0, that is Gregorian date 2000 Jan 1 at 12h (noon).
https://en.wikipedia.org/wiki/Epoch_(astronomy)#Julian_dates_and_J2000
Functions ¶
func DaysSinceMarch1st ¶
DaysSinceMarch1st returns, for the given month and day, the number of days since the previous March 1st.
func YMD ¶
YMD returns, for the date which is the argument number of days since calendar day {Y:0, M: 3, D:1}, its year (can be either 0 or 1), month (1..12), and day (1..31).
The argument number of days should not exceed 365 by more than a few days.
The argument bool value shall be true if year 1 is a leap year.
Types ¶
type AstronomicalAngle ¶
type AstronomicalAngle float64
AstronomicalAngle is an angle in degrees.
func (AstronomicalAngle) DMSDegrees ¶
func (aa AstronomicalAngle) DMSDegrees() int
DMSDegrees is the degrees component of the receiver angle when expressed in the Degrees, Minutes, and Seconds format.
func (AstronomicalAngle) HMSHours ¶
func (aa AstronomicalAngle) HMSHours() int
HMSHours is the hours component of the receiver angle when expressed in the Hours, Minutes, and Seconds format.
The returned value is a positive integer in the range 0..24.
type Degree ¶
type Degree float64
Degree is a unit of angle measurement, 360 degrees per turn.
type EquatorialCoordinates ¶
type EquatorialCoordinates struct { // The coordinate which uses the direction of the vernal equinox as its // positive axis. X float64 // The coordinate whose positive axis is the vector cross product of the // Z-axis with the X-axis, in that order. Y float64 // The coordinate which uses the direction of the celestial north pole as // its positive axis. Z float64 }
EquatorialCoordinates is a point in a equatorial coordinate system: https://en.wikipedia.org/wiki/Equatorial_coordinate_system.
func (EquatorialCoordinates) Declination ¶
func (ec EquatorialCoordinates) Declination() Degree
Declination is the signed angle, measured in degrees, between the celestial equator's plane and the line segment joining the receiver position to the origin.
The north celestial pole has a declination of +90 degrees.
func (EquatorialCoordinates) RightAscension ¶
func (ec EquatorialCoordinates) RightAscension() Degree
RightAscension (right ascension) is the signed angle, measured in degrees, between the equinox and the orthogonal projection onto the celestial equator of the line segment joining the receiver position to the origin.
type Gregorian ¶
type Gregorian struct { /// The day, in the range 1..31. D int // The month, in the range 1..12. M int // The year. Y GregorianYear }
A Gregorian is a specific calendar day in the proleptic Gregorian calendar.
type GregorianYear ¶
type GregorianYear int
A GregorianYear is a particular year in the Gregorian calendar specified in astronomical year numbering: https://en.wikipedia.org/wiki/Astronomical_year_numbering. In astronomical year numbering there is a year 0 and negative years are allowed.
func (GregorianYear) IsLeap ¶
func (gy GregorianYear) IsLeap() bool
IsLeap shall return true if the receiver year is a leap year in the proleptic Gregorian calendar.
type JD ¶
type JD struct { JDN JDN // The fraction of a solar day, in the range 0..1, since the preceding noon. Fraction float64 }
JD is a Julian Date: https://en.wikipedia.org/wiki/Julian_day.
func NewJD ¶
NewJD from the given Julian Date.
The integer component of the given Julian Date is the Julian Day Number and the fractional component is the fraction of a solar day, in the range 0..1, since the preceding noon.
func (JD) Add ¶
Add the given duration measured in units of Julian days to the receiver date and return the resulting date.
type JDN ¶
type JDN int
A JDN is a specific Julian Day Number: https://en.wikipedia.org/wiki/Julian_day.
The Julian Day Number 0 corresponds to the calendar day starting at noon on:
JulianDay{Y:-4712, M:1, N:1}, that is, Julian 4713 BC January 1st;
GregorianDay{Y:-4713, M:11, D:24}, that is, Gregorian 4714 BC November 24th.
type Julian ¶
type Julian struct { /// The day, in the range 1..31. D int // The month, in the range 1..12. M int // The year. Y JulianYear }
A Julian is a specific calendar day in the proleptic Julian calendar.
type JulianYear ¶
type JulianYear int
A JulianYear is a particular year in the Julian calendar specified in astronomical year numbering: https://en.wikipedia.org/wiki/Astronomical_year_numbering. In astronomical year numbering there is a year 0 and negative years are allowed.
func (JulianYear) IsLeap ¶
func (jy JulianYear) IsLeap() bool
IsLeap shall return true if the receiver year is a leap year in the proleptic Julian calendar.
type SphericalCoordinates ¶
SphericalCoordinates is a point in a spherical coordinate system: https://en.wikipedia.org/wiki/Spherical_coordinate_system
func (SphericalCoordinates) Equatorial ¶
func (sc SphericalCoordinates) Equatorial() EquatorialCoordinates
Equatorial returns the receiver position in equatorial coordinates.
Directories ¶
Path | Synopsis |
---|---|
Package hipparcos reproduces a subset of the Hipparcos star catalog.
|
Package hipparcos reproduces a subset of the Hipparcos star catalog. |
horizons
Package horizons interfaces with the JPL Horizons online solar system data and ephemeris computation service (https://ssd.jpl.nasa.gov/horizons/).
|
Package horizons interfaces with the JPL Horizons online solar system data and ephemeris computation service (https://ssd.jpl.nasa.gov/horizons/). |
keplerian
Package keplerian reproduces orbital elements from
|
Package keplerian reproduces orbital elements from |