Reference · Rockets, variants, parts and the fit check
easedDistancefunction
A distance between two camera distances, even in scale. The halfway point is the geometric mean, so 60 m to 1 800 m does not rush the far end.
Import it
import { easedDistance } from "@johnmorrisdotca/uchusen-rockets";
Definition
function easedDistance(from: number, to: number, t: number): number
Parameters
| Name | Type | Description |
|---|---|---|
from | number | The distance at the start, in metres. |
to | number | The distance at the end, in metres. |
t | number | How far along the move is, from 0 to 1. |
Returns
number
The distance at t, in metres.
Examples
import { easedDistance } from "@johnmorrisdotca/uchusen-rockets";
console.log(easedDistance(60, 1800, 0.5).toFixed(0));329What it prints (run when this page was built)