limitAtSliderfunction
The limit at a slider's position, 0 to 1, on a scale where each step is the same ratio (4 light-years to 3 million). Position 1 is all (Infinity).
Import it
import { limitAtSlider } from "@johnmorrisdotca/hoshi-stars/distance";
Definition
function limitAtSlider(position: number): number
Parameters
| Name | Type | Description |
|---|---|---|
position | number | 0 to 1. |
Returns
number
The limit in light-years.
Examples
import { limitAtSlider } from "@johnmorrisdotca/hoshi-stars/distance";
console.log(Math.round(limitAtSlider(0)), Math.round(limitAtSlider(0.5)), limitAtSlider(1));4 3464 InfinityWhat it prints (run when this page was built)