Reference · Journey mode: transfers, launch windows and flip-and-burn trips
lightTimefunction
The time light takes to cross a distance, in the unit that reads best.
Import it
import { lightTime } from "@johnmorrisdotca/uchusen-rockets/journey";
Definition
function lightTime(km: number): string
Parameters
| Name | Type | Description |
|---|---|---|
km | number | Kilometres. |
Returns
string
For example 1.28 light-seconds, 8.3 light-minutes or 4.37 light-years.
Examples
import { lightTime } from "@johnmorrisdotca/uchusen-rockets/journey";
console.log(lightTime(384_400), lightTime(149_597_870.7));1.28 light-seconds 8.3 light-minutesWhat it prints (run when this page was built)