Reference · Journey mode: transfers, launch windows and flip-and-burn trips
planTripfunction
Plans a trip: the transfer or the flip and burn, the burns, the times, and what the craft can and cannot do. A craft that cannot make the trip comes back with a verdict that says why in one line and no phases.
Import it
import { planTrip } from "@johnmorrisdotca/uchusen-rockets/journey";
Definition
function planTrip(source: BodySource, craft: Craft, from: string, to: string, departMs: number, g?: number, via?: "jupiter"): Trip
Parameters
| Name | Type | Description |
|---|---|---|
source | BodySource | Where the places are. |
craft | Craft | The craft. |
from | string | The starting place's id. |
to | string | The destination's id. |
departMs | number | When the departure burn begins, milliseconds since 1970 (for a ballistic trip to a planet, one of |
g (optional) | number | undefined | Proper acceleration in g for a ship that burns all the way. Omitted, the ship flies at its rated acceleration. A ballistic craft ignores it. |
via (optional) | "jupiter" | undefined |
|
Returns
Trip
The planned trip.
Examples
import { craftOf, planTrip, type BodySource } from "@johnmorrisdotca/uchusen-rockets/journey";
declare const source: BodySource;
const trip = planTrip(source, craftOf("saturn-v")!, "earth", "moon", Date.UTC(2026, 10, 5));
console.log(trip.verdict.line, Math.round(trip.dv.departure));