Helios bundles two solar position calculation libraries.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/V3RNE42/helios/llms.txt
Use this file to discover all available pages before exploring further.
SunCalc_function.js is used by the route algorithm for sunrise/sunset detection; suncalc.js provides the getTimes function used for attaching solar noon to each route section in the main application logic.
SunCalc_function.js
SunCalc_function.js exports a single default factory function. Call it once to obtain the solar calculation methods:
getDayInfo(date, lat, lng, detailed?)
Returns a day-info object containing the principal solar events for a given date and location.
The date for which to calculate solar events.
Latitude in decimal degrees.
Longitude in decimal degrees.
When
true, the returned object is extended with morningTwilight and nightTwilight breakdowns.| Property | Type | Description |
|---|---|---|
dawn | Date | Nautical twilight start (morning). |
sunrise.start | Date | Geometric sunrise — bottom of the solar disc touches the horizon. |
sunrise.end | Date | Optical sunrise end — top of the solar disc clears the horizon. |
transit | Date | Solar noon — the Sun crosses the meridian. |
sunset.start | Date | Optical sunset start — top of the solar disc touches the horizon. |
sunset.end | Date | Geometric sunset — bottom of the solar disc sets below the horizon. |
dusk | Date | Nautical twilight end (evening). |
detailed: true, two additional properties are included:
morningTwilight
| Sub-property | Description |
|---|---|
astronomical.start / .end | Astronomical twilight window in the morning. |
nautical.start / .end | Nautical twilight window in the morning. |
civil.start / .end | Civil twilight window in the morning. |
nightTwilight
| Sub-property | Description |
|---|---|
civil.start / .end | Civil twilight window in the evening. |
nautical.start / .end | Nautical twilight window in the evening. |
astronomical.start / .end | Astronomical twilight window in the evening. |
getSunPosition(date, lat, lng)
Returns the Sun’s position in the sky for a given moment and location.
The date and time of observation.
Latitude in decimal degrees.
Longitude in decimal degrees.
{ azimuth: number, altitude: number } — both values in radians.
suncalc.js
suncalc.js exposes its API through a named SunCalc export:
getTimes(date, lat, lng, height?)
Calculates sun times for a given date, latitude/longitude, and optional observer height.
The date for which to calculate sun times.
Latitude in decimal degrees.
Longitude in decimal degrees.
Observer height in metres above the horizon. Defaults to
0.solarNoon (Date) and nadir (Date), plus named rise/set pairs for each configured solar angle: sunrise/sunset, sunriseEnd/sunsetStart, dawn/dusk, nauticalDawn/nauticalDusk, nightEnd/night, and goldenHourEnd/goldenHour.
In index_def.js, getTimes is called at both origin and destination to populate datos.start.solarnoon and datos.end.solarnoon:
Consistency guarantee
The test suite verifies thatgetTimes(...).solarNoon and getDayInfo(...).transit agree to within 5 minutes for the same inputs, ensuring that solar noon is reported consistently regardless of which library path is used:
Both
SunCalc_function.js and suncalc.js are based on the SunCalc algorithm created by Volodymyr Agafonkin. The original library is available at github.com/mourner/suncalc.