Reference · The <wakusei-space> element: the Earth, Moon, Sun and planets in their places
RidePointtype
Any moving point a camera can ride: where it is and which way it goes at a moment, from the centre of the body it goes round, in kilometres and kilometres a second, in the scene's axes (J2000
equatorial, y north). It returns null when it cannot be placed then (its data too old, or it is gone). The space view knows nothing of what the point is: a satellite, a probe, a station.
Import it
import type { RidePoint } from "@johnmorrisdotca/wakusei-planets/space/element";
Definition
interface RidePoint {
at(ms: number): {
position: SpaceVec3;
velocity: SpaceVec3;
} | null;
}
Members
| Name | Type | Description |
|---|---|---|
at | (ms: number): { position: SpaceVec3; velocity: SpaceVec3; } | null |
Examples
import type { RidePoint } from "@johnmorrisdotca/wakusei-planets/space/element";
const circle: RidePoint = { at: (ms) => ({ position: [7000 * Math.cos(ms / 1e6), 0, 7000 * Math.sin(ms / 1e6)], velocity: [0, 7.5, 0] }) };
console.log(circle.at(0)?.position[0]);