Reference · Journey mode: transfers, launch windows and flip-and-burn trips
Statetype
What is true of the craft at a moment: its place, speed, acceleration, the distances, the clocks, the signal time home and how far it has turned round.
Import it
import type { State } from "@johnmorrisdotca/uchusen-rockets/journey";
Definition
interface State extends Place {
dateMs: number;
burn: "off" | "forward" | "reverse";
speedFrame: "start" | "earth" | "sun" | "destination";
speedMs: number;
gamma: number;
accelG: number;
doneKm: number;
progress: number;
toDestinationKm: number;
positionKm: Vec3;
shipS: number;
frameS: number;
signalS: number;
turned: number;
}
Members
| Name | Type | Description |
|---|---|---|
dateMs | number | |
burn | "off" | "forward" | "reverse" | Which way the engine is firing: not at all, pushing it on, or against its motion. |
speedFrame | "sun" | "earth" | "start" | "destination" | How the speed is measured: from the start or destination (for a ship that burns all the way), from the Earth, the Sun or the destination. |
speedMs | number | |
gamma | number | |
accelG | number | The acceleration, in g, positive along the motion. |
doneKm | number | Path flown, km, and the fraction of the path, 0 to 1. |
progress | number | |
toDestinationKm | number | The straight line from the craft to the destination, km. |
positionKm | Vec3 | The craft's place in the trip's frame, km. |
shipS | number | Time on board since lift-off and time since lift-off in the frame of the places, seconds. |
frameS | number | |
signalS | number | How long a signal takes to get home from here, seconds. |
turned | number | How far the craft has turned round, 0 (facing forward) to 1 (facing back). |
phase | Phase | |
index | number | |
fraction | number | How far through the phase, 0 to 1. |
missionS | number | Mission seconds from lift-off (negative before). |
scale | number | Mission seconds shown per second on the screen in this phase. |
Examples
import type { State } from "@johnmorrisdotca/uchusen-rockets/journey";
const speed = (state: State) => `${Math.round(state.speedMs)} m/s`;
console.log(typeof speed);functionWhat it prints (run when this page was built)