twilightOffunction
The kind of twilight for a Sun altitude: "day" above -0.833 degrees (the upper edge on the horizon, with refraction), "civil" to -6, "nautical" to -12, "astronomical" to -18, then "night".
Import it
import { twilightOf } from "@johnmorrisdotca/hoshi-stars/tonight";
Definition
function twilightOf(altitude: number): Twilight
Parameters
| Name | Type | Description |
|---|---|---|
altitude | number | The Sun's altitude in degrees. |
Returns
Twilight
The twilight.
Examples
import { twilightOf } from "@johnmorrisdotca/hoshi-stars/tonight";
console.log(twilightOf(10), twilightOf(-9), twilightOf(-30)); // day nautical nightday nautical nightWhat it prints (run when this page was built)