streakPathfunction
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 it
import { streakPath } from "@johnmorrisdotca/chikyu-earth/meteors";
Definition
function streakPath(place: readonly [number, number, number], radiant: readonly [number, number, number], stretch?: number): { start: Vec3; end: Vec3; km: number; }
Parameters
| Name | Type | Description |
|---|---|---|
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 (optional) | number | How many times longer than true to draw it; 1 is true. |
Returns
{ start: Vec3; end: Vec3; km: number; }
The two ends, and the true length in kilometres.
Examples
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 110What it prints (run when this page was built)