Need help with solar-calculator?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

mbostock
134 Stars 24 Forks ISC License 15 Commits 3 Opened issues

#### Description

Equations for computing the position of the Sun.

!
?

#### Contributors list

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.

# solar.century(date) <>

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.)

# solar.declination(t) <>

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.

# solar.equationOfTime(t) <>

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.

# solar.meanAnomaly(t) <>

Given a time t in J2000.0 centuries, returns the Sun’s mean anomaly in degrees.

# solar.meanLongitude(t) <>

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.)

# solar.trueLongitude(t) <>

Given a time t in J2000.0 centuries, returns the Sun’s true longitude in degrees.