Reference · Journey mode: transfers, launch windows and flip-and-burn trips
bestDatefunction
The departure date, for a craft that burns all the way, with the shortest trip in the next two years.
Import it
import { bestDate } from "@johnmorrisdotca/uchusen-rockets/journey";
Definition
function bestDate(source: BodySource, craft: Craft, from: string, to: string, afterMs: number, g?: number): number
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. |
afterMs | number | The earliest date. |
g (optional) | number | undefined | Proper acceleration in g. Omitted, the ship flies at its rated acceleration. Passed on to |
Returns
number
The date, milliseconds since 1970.
Examples
import { bestDate, craftOf, type BodySource } from "@johnmorrisdotca/uchusen-rockets/journey";
declare const source: BodySource;
console.log(new Date(bestDate(source, craftOf("kaminari")!, "earth", "mars", Date.UTC(2026, 10, 4))).toISOString());