streakPath関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Where one streak runs: from start to end, in Earth radii from the centre, in the Earth's own axes.
It ends METEOR_HEIGHT_KM.bottom + 5 km up and comes down the line from the radiant; its true length is the drop in height
divided by the sine of the radiant's height, at most 260 km, and stretch (1 or more) lengthens it for the eye.
インポート
import { streakPath } from "@johnmorrisdotca/chikyu-earth/meteors";
定義
function streakPath(place: readonly [number, number, number], radiant: readonly [number, number, number], stretch?: number): { start: Vec3; end: Vec3; km: number; }
引数
| 名前 | 型 | 説明 |
|---|---|---|
place | readonly [number, number, number] | The unit vector of the place it ends over. |
radiant | readonly [number, number, number] | The unit vector towards the radiant (it must stand above that place's horizon). |
stretch (省略可) | number | How many times longer than true to draw it; 1 is true. |
戻り値
{ start: Vec3; end: Vec3; km: number; }
The two ends, and the true length in kilometres.
例
import { placeVector, streakPath } from "@johnmorrisdotca/chikyu-earth/meteors";
const place = placeVector({ lon: 0, lat: 0 });
// Straight down from overhead: it falls 25 km, from 110 km up to 85 km.
const path = streakPath(place, place, 1);
console.log(path.km.toFixed(0), ((Math.hypot(...path.start) - 1) * 6371).toFixed(0)); // "25" "110"25 110出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。