Reference · Where the Sun, Moon and planets are for a date, in two scales, with the camera maths
placeBodiesfunction
Where every body of the view is, in Earth radii from the Earth's centre, at one moment: the Earth at the centre, the Moon, the Sun and the planets. The same mapping places
the bodies and the lines of their orbits (orbitLine), so a body is always on its own orbit.
Import it
import { placeBodies } from "@johnmorrisdotca/wakusei-planets/space";
Definition
function placeBodies(mode: ScaleMode, frame: SpaceFrame): Record<BaseBody, Vec3>
Parameters
| Name | Type | Description |
|---|---|---|
mode | ScaleMode | The scale. |
frame | SpaceFrame | Where everything is, from |
Returns
Record<BaseBody, Vec3>
The place of each body.
Examples
import { frameAt, placeBodies } from "@johnmorrisdotca/wakusei-planets/space";
const places = placeBodies("compressed", frameAt(Date.UTC(2026, 10, 2)));
console.log(Object.keys(places).length);11What it prints (run when this page was built)