sliderOfLimitfunction
Where a limit sits on the slider, 0 to 1; all is 1 and a limit under the slider's start is 0. The inverse of limitAtSlider.
Import it
import { sliderOfLimit } from "@johnmorrisdotca/hoshi-stars/distance";
Definition
function sliderOfLimit(limit: number): number
Parameters
| Name | Type | Description |
|---|---|---|
limit | number | The limit in light-years. |
Returns
number
A position from 0 to 1.
Examples
import { sliderOfLimit } from "@johnmorrisdotca/hoshi-stars/distance";
console.log(sliderOfLimit(100).toFixed(3), sliderOfLimit(Infinity));0.238 1What it prints (run when this page was built)