darknessfunction
How dark the sky is at a place, from 0 (the Sun is up) to 1 (the Sun is 6 degrees or more below the horizon, the end of civil twilight), rising evenly between: meteors are counted as seen only where it is dark.
Import it
import { darkness } from "@johnmorrisdotca/chikyu-earth/meteors";
Definition
function darkness(place: readonly [number, number, number], sun: readonly [number, number, number]): number
Parameters
| Name | Type | Description |
|---|---|---|
place | readonly [number, number, number] | The place's unit vector ( |
sun | readonly [number, number, number] | The unit vector of the place the Sun is overhead. |
Returns
number
0 to 1.
Examples
import { darkness, placeVector } from "@johnmorrisdotca/chikyu-earth/meteors";
const sun = placeVector({ lon: 0, lat: 0 });
console.log(darkness(placeVector({ lon: 0, lat: 0 }), sun), darkness(placeVector({ lon: 180, lat: 0 }), sun)); // 0 10 1What it prints (run when this page was built)