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.
trigo.js contains the spherical mathematics that allow Helios to find the geographic position of the vehicle at any fraction of its journey. It is a pure module with no external dependencies.
Exports
getNewCoords(startCoords, endCoords, fraction)
Returns the interpolated geographic position at a given progress fraction along the great-circle path between two coordinates.
Origin coordinates.
Destination coordinates.
Progress fraction between
0 (origin) and 1 (destination).{ lat, lon } — the interpolated geographic position.
Returns startCoords immediately if fraction === 0, and endCoords immediately if fraction === 1. Otherwise it delegates to getAngularDistance, getBearing, and getDestinationCoords for full great-circle interpolation.
getAngularDistance(startCoords, endCoords)
Returns the great-circle distance between two geographic coordinates in kilometres.
Origin coordinates.
Destination coordinates.
number — distance in kilometres, computed using the haversine formula with Earth radius 6371 km.
getAbsoluteDiff(num1, num2)
Returns the absolute difference between two numbers.
First number.
Second number.
number — |num1 - num2|.
Used by computeRouteSections in routeSolar.js to measure the convergence error (diff) of the iterative solar event search: once diff falls below MAX_DIFF (2500 ms), the inner loop exits.
Internal helpers
These functions are not exported and are used only withintrigo.js:
| Helper | Purpose |
|---|---|
getBearing(startCoords, endCoords) | Computes the initial compass bearing (in radians, normalised to 0–2π) between two coordinates using the forward azimuth formula. |
getDestinationCoords(startCoords, distance, bearing) | Calculates the destination point given an origin, a distance in kilometres, and a bearing, using the spherical law of cosines with Earth radius 6371 km. |
toRadians(degrees) | Converts decimal degrees to radians (degrees × π / 180). |
toDegrees(radians) | Converts radians to decimal degrees (radians × 180 / π). |