In the Northern Hemisphere the sun traces its arc across the southern sky. Before solar noon it is climbing toward the south-east; after solar noon it is descending toward the south-west. That single geometric fact is the engine behind every recommendation Helios makes: combine the direction a vehicle is travelling with whether the current moment is before or after solar noon, and you can determine which window the sun will be shining through.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.
The four cases
Helios reduces every journey segment to one of four cases. The table below is reproduced directly from the project’s core algorithm specification:| Left | Right | Condition | Direction |
|---|---|---|---|
| SUN | SHADE | Before solar noon | North to South |
| SHADE | SUN | Before solar noon | South to North |
| SHADE | SUN | After solar noon | North to South |
| SUN | SHADE | After solar noon | South to North |
Solar noon as the dividing line
Clock noon and solar noon are different things. Solar noon is the moment when the sun reaches its highest point in the sky at a given longitude — it can be more than 30 minutes away from 12:00 on the clock, depending on the time of year and where in a time zone you are. Helios never uses clock noon as the dividing line. Instead it calculates the true solar noon for each geographic position along the route. Inindex_def.js, solar noon is obtained from SunCalc.getTimes() for both the origin and the destination:
Seat-change logic
The user interface exposes a cambio (“can you change seats?”) toggle. Its effect depends on whether the journey spans solar noon: When seat changes are enabled (cambio = true):
Helios can recommend sitting on one side up to solar noon and then switching to the other side. If sunrise and solar noon are not at the same moment, the result text instructs the traveller to sit on side A from departure until solar noon, then move to side B for the remainder.
When seat changes are disabled (cambio = false):
Helios picks a single side for the entire segment. It does this by comparing how much time is spent before solar noon versus after:
sunrise → noon) is longer than or equal to the afternoon portion (noon → sunset), the “before solar noon” row of the four-case table wins. Otherwise the “after solar noon” row wins.
The getLeftSeat function
Once the AM/PM status and the travel direction are known, a small pure function translates them into a concrete side:
ams—trueif the current moment is before solar noon (Ante Meridiano Solar),falseif after.NaS—trueif the vehicle is travelling North-to-South,falseif South-to-North.datos["sun"]—trueif the user wants to maximise sun exposure,falseif they want shade.
if (!…) flips the recommendation. Starting from “left = sun, north-to-south, before noon”, any deviation from that baseline inverts the answer once. If two conditions deviate, the inversions cancel out and the original answer is restored — which is exactly what the four-case table predicts.
Handling edge cases
Night-time travel:computeRouteSections in routeSolar.js detects whether the entire journey falls between sunset and the following sunrise. When night = true, renderResults renders a 🌙 message instead of a seat recommendation.
Multi-day journeys: The outer loop in computeRouteSections runs until it has found all solar events between departure and arrival. The loop limit is set dynamically based on trip duration (limit = floor(total_time × 2 / ONE_DAY)), so a three-day trip gets a proportionally larger budget of iterations than a single-day trip. Each (sunrise, sunset) pair becomes one independent section, each rendered as a separate card in the results.
Polar and high-latitude travel: At extreme latitudes, the sun may not rise or set on a given day. If getDayInfo cannot find a sunrise or sunset — because the sun is either always above or always below the horizon — the segment either has no daylight events to record (treated as all-night) or the times returned fall outside the journey window and are handled by sectionFormatter’s boundary logic.
Helios assumes a straight-line (great-circle) route between origin and destination. Real roads, rail tracks, and flight paths curve, detour, and change compass bearing continuously. The recommendation is therefore an approximation based on the overall direction of travel, not a turn-by-turn analysis.