Documentation ¶
Index ¶
- Constants
- func ArgumentOfPerihelion(d float64) float64
- func Declination(eclipticLongitude float64) float64
- func EclipticLongitude(solarAnomaly, equationOfCenter, d float64) float64
- func Elevation(latitude, longitude float64, when time.Time) float64
- func EquationOfCenter(solarAnomaly float64) float64
- func HourAngle(latitude, declination float64) float64
- func JulianDayToTime(d float64) time.Time
- func MeanSolarNoon(longitude float64, year int, month time.Month, day int) float64
- func Round(f float64, places int) float64
- func SolarMeanAnomaly(d float64) float64
- func SolarTransit(d, solarAnomaly, eclipticLongitude float64) float64
- func SunriseSunset(latitude, longitude float64, year int, month time.Month, day int) (time.Time, time.Time)
- func TimeOfElevation(latitude, longitude, elevation float64, year int, month time.Month, day int) (time.Time, time.Time)
- func TimeToJulianDay(t time.Time) float64
Constants ¶
const ( // Degree provides a precise fraction for converting between degrees and // radians. Degree = math.Pi / 180 // J2000 is the Julian date for January 1, 2000, 12:00:00 TT. J2000 = 2451545 )
const DefaultPlaces = 5
DefaultPlaces specifies the default precision for rounding.
Variables ¶
This section is empty.
Functions ¶
func ArgumentOfPerihelion ¶
ArgumentOfPerihelion calculates the argument of periapsis for the earth on the given Julian day.
func Declination ¶
Declination calculates one of the two angles required to locate a point on the celestial sphere in the equatorial coordinate system. The ecliptic longitude parameter must be in degrees.
func EclipticLongitude ¶
EclipticLongitude calculates the angular distance of the earth along the ecliptic.
func Elevation ¶ added in v1.1.0
Elevation calculates the angle of the sun above the horizon at a given moment at the specified location.
func EquationOfCenter ¶
EquationOfCenter calculates the angular difference between the position of the earth in its elliptical orbit and the position it would occupy in a circular orbit for the given mean anomaly.
func HourAngle ¶
HourAngle calculates the second of the two angles required to locate a point on the celestial sphere in the equatorial coordinate system.
func JulianDayToTime ¶
JulianDayToTime converts a Julian day into a time.Time.
func MeanSolarNoon ¶
MeanSolarNoon calculates the time at which the sun is at its highest altitude. The returned time is in Julian days.
func Round ¶
Round takes the provided float and rounds it to the specified number of decimal places. This function is adapted from user korya on GitHub (https://gist.github.com/DavidVaini/10308388#gistcomment-1391788).
func SolarMeanAnomaly ¶
SolarMeanAnomaly calculates the angle of the sun relative to the earth for the specified Julian day.
func SolarTransit ¶
SolarTransit calculates the Julian data for the local true solar transit.
func SunriseSunset ¶
func SunriseSunset(latitude, longitude float64, year int, month time.Month, day int) (time.Time, time.Time)
SunriseSunset calculates when the sun will rise and when it will set on the given day at the specified location. Returns time.Time{} if there sun does not rise or set
func TimeOfElevation ¶ added in v1.1.0
func TimeOfElevation(latitude, longitude, elevation float64, year int, month time.Month, day int) (time.Time, time.Time)
TimeOfElevation calculates the times of day when the sun is at a given elevation above the horizon on a given day at the specified location. Returns time.Time{} if there sun does not reach the elevation
func TimeToJulianDay ¶
TimeToJulianDay converts a time.Time into a Julian day.
Types ¶
This section is empty.