phaseAt関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Which phase a place on the timeline is in, and how far along to the next. A value that is not a number is the start.
インポート
import { phaseAt } from "@johnmorrisdotca/uchusen-rockets";
定義
function phaseAt(flight: Flight, position: number): { index: number; along: number; phase: FlightPhase; }
引数
| 名前 | 型 | 説明 |
|---|---|---|
flight | Flight | A flight. |
position | number | A place on the timeline: 0 is the first phase, 1 the second, 1.5 halfway to the third. |
戻り値
{ index: number; along: number; phase: FlightPhase; }
The phase index, how far along to the next (0 to 1) and the phase.
例
import { flightOf, phaseAt } from "@johnmorrisdotca/uchusen-rockets";
const flight = flightOf("falcon-9", "block-5");
if (flight) console.log(phaseAt(flight, 1.5).phase.name);Liftoff出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。