terminatorFor

function terminatorFor
terrainPalette.ts:259
terminatorFor(hasAir: boolean, relief: number, radius: number) → number

Half-width of a body's terminator, in cosine of the incidence angle.

Exported because the sphere has to use the same number. A disk drawn from a photograph would end at 0.025 on an airless body, because its surface is smooth at the resolution of the map; terrain is not, and a peak of height h catches the sun √(2h/R) of a radian past the geometric shadow line. Given to the ground alone, the two halves of one body fade out over bands differing by 4.2× on Luna and 6.6× on Iapetus, and a descent crossing the eight-pixel gate walks straight through that step — which is the third of the three terms AGENTS.md names as shared.

Widening the disk is the right direction rather than a concession. Its normal map carries real slopes at 2.2× exaggeration on an airless body, and the Moon's terminator seen from space genuinely is ragged over about the angle its relief subtends. On a body with air the wider figure is already the air's own 0.09 and this changes nothing: Earth and Mars were the two that agreed before, and they agree by taking the same branch.

Scalars rather than a Body, because the two callers hold different things — the palette a Body, buildScene a BodySnapshot — and both already carry a relief and a radius. The radius is the equatorial one on both sides; the mean differs from it by under half a percent, which is nothing under a square root.

hasAirboolean
Undocumented
reliefnumber
Undocumented
radiusnumber
Undocumented
Returnsnumber