Reference · Where the Sun, Moon and planets are for a date, in two scales, with the camera maths
orbitLinefunction
The line of a body's orbit as the view draws it: the points from planetOrbit (astronomical units from the Sun) placed round the Sun at sun by the same mapping as the bodies.
Import it
import { orbitLine } from "@johnmorrisdotca/wakusei-planets/space";
Definition
function orbitLine(mode: ScaleMode, sun: Vec3, points: readonly Vec3[]): Vec3[]
Parameters
| Name | Type | Description |
|---|---|---|
mode | ScaleMode | The scale. |
sun | Vec3 | Where the Sun is drawn, from |
points | readonly Vec3[] | The orbit, from |
Returns
Vec3[]
The same points, in Earth radii from the Earth's centre.
Examples
import { frameAt, orbitLine, placeSun, planetOrbit } from "@johnmorrisdotca/wakusei-planets/space";
const ms = Date.UTC(2026, 10, 2);
console.log(orbitLine("compressed", placeSun("compressed", frameAt(ms).sun), planetOrbit("earth", ms, 24)).length);25What it prints (run when this page was built)