Module: SunPosition

Provides utilities for determining the Sun geographic and celestial location.
Source:

Methods

(static) celestialToGeographic(celestialLocation, date) → {Object}

Converts from celestial coordinates (declination and right ascension) to geographic coordinates (latitude, longitude) for a given julian date
Parameters:
Name Type Description
celestialLocation Object
date Date
Source:
Throws:
if celestialLocation or julianDate are missing
Type
ArgumentError
Returns:
the geographic location
Type
Object

(static) computeJulianDate(date) → {Number}

Computes the julian date from a javascript date object
Parameters:
Name Type Description
date Date
Source:
Throws:
if the date is missing
Type
ArgumentError
Returns:
the julian date
Type
Number

(static) getAsCelestialLocation(date) → {Object}

Computes the celestial location of the sun for a given julianDate
Parameters:
Name Type Description
date Date
Source:
Throws:
if the date is missing
Type
ArgumentError
Returns:
the celestial location
Type
Object

(static) getAsGeographicLocation(date) → {Object}

Computes the geographic location of the sun for a given date
Parameters:
Name Type Description
date Date
Source:
Throws:
if the date is missing
Type
ArgumentError
Returns:
the geographic location
Type
Object

(static) normalizeAngle360(degrees) → {Number}

Restricts an angle to the range [0, 360] degrees, wrapping angles outside the range. Wrapping takes place as though traversing the edge of a unit circle; angles less than 0 wrap back to 360, while angles greater than 360 wrap back to 0.
Parameters:
Name Type Description
degrees Number the angle to wrap in degrees
Source:
Returns:
the specified angle wrapped to [0, 360] degrees
Type
Number