Equations based on NOAA’s Solar Calculator.
Examples:
API Reference
# solar.apparentLongitude(t) <>
Given a time t in J2000.0 centuries, returns the Sun’s apparent longitude in degrees.
Given a date, returns the fraction number of centures since the J2000.0 epoch, 2000-01-01T12:00:00Z. (No correction is made between Terrestrial Time and UTC.)
Given a time t in J2000.0 centuries, returns the Sun’s declination in degrees.
# solar.equationOfCenter(t) <>
Given a time t in J2000.0 centuries, returns the Sun and Earth’s equation of the center in degrees.
Given a time t in J2000.0 centuries, returns the Sun and Earth’s equation of time in minutes.
# solar.hours(date, latitude) <>
Given a date and a latitude in degrees, returns the number of daylight hours.
Given a time t in J2000.0 centuries, returns the Sun’s mean anomaly in degrees.
Given a time t in J2000.0 centuries, returns the Sun’s mean longitude in degrees.
# solar.noon(date, longitude) <>
Given a date and a longitude in degrees, returns the time of the solar noon. (TODO This description isn’t quite right, because the date is first floored to the UTC day boundary and then adjusted based on the specified longitude.)
# solar.obliquityOfEcliptic(t) <>
Given a time t in J2000.0 centuries, returns the obliquity of the ecliptic in degrees.
# solar.orbitEccentricity(t) <>
Given a time t in J2000.0 centuries, returns Earth’s orbital eccentricity.
# solar.riseHourAngle(date, latitude) <>
Given a date and a latitude in degrees, returns the hour angle of sunrise on the given day in degrees.
# solar.rise(date, latitude, longitude) <>
Given a date and a latitude and longitude in degrees, returns the time of sunrise. (TODO Describe more precisely the date of the returned sunrise.)
# solar.set(date, latitude, longitude) <>
Given a date and a latitude and longitude in degrees, returns the time of sunset. (TODO Describe more precisely the date of the returned sunset.)
Given a time t in J2000.0 centuries, returns the Sun’s true longitude in degrees.