Skip to the content

Wakusei Planets惑星

The Sun, the planets and their moons as a clean line drawing, a shaded realistic drawing or a painted surface map, with real sizes, tilt and rotation, and the moons where they are at any date and time.

Wakusei is the Japanese word 惑星 for a planet. About the name

Contents

Reference · Where the Sun, Moon and planets are for a date, in two scales, with the camera maths

createTrackfunction

Answers for any moment from two real ones: at(ms) works out a frame only when ms leaves the span the last two answers cover, and then looks stepMs ahead, so playing time at a steady rate costs one pair of lookups every stepMs and every draw in between is arithmetic.

Import it

import { createTrack } from "@johnmorrisdotca/wakusei-planets/space";

Definition

function createTrack(initialStepMs?: number): { at(ms: number): SpaceFrame; ends(): [SpaceFrame, SpaceFrame] | undefined; readonly lookups: number; reset(): void; setStep(ms: number): void; }

Parameters

NameTypeDescription
initialStepMs (optional)number

How far ahead the second answer looks, in milliseconds.

Returns

{ at(ms: number): SpaceFrame; ends(): [SpaceFrame, SpaceFrame] | undefined; readonly lookups: number; reset(): void; setStep(ms: number): void; }

A track: at(ms) for a frame, lookups for how many frames were worked out, ends() for the two answers it is between (undefined before the first at), reset() and setStep(ms).

Examples

import { createTrack } from "@johnmorrisdotca/wakusei-planets/space";

const track = createTrack(1000);
const start = Date.UTC(2026, 10, 2);
for (let step = 0; step < 10; step += 1) track.at(start + step * 50);
console.log(track.lookups);
2

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/wakusei-planets 0.24.0.