pickTurns()
pixi-wheels / index / pickTurns
Function: pickTurns()
function pickTurns(
base: number,
slope: number,
speed: number,
profile: SpinProfile
): {
distance: number;
duration: number;
turns: number;
};
Defined in: spin/StopPlanner.ts:93
Choose how many full turns a stop should make.
With the ease’s start slope matched to the cruise speed, the duration is
fixed by the distance: T = D * slope / v. So the planner cannot pick a
duration directly; it picks the turn count whose duration lands closest
to the profile’s stopDuration, within [minTurns, maxTurns].
Parameters#
| Parameter | Type |
|---|---|
base | number |
slope | number |
speed | number |
profile | SpinProfile |
Returns#
{
distance: number;
duration: number;
turns: number;
}
| Name | Type | Defined in |
|---|---|---|
distance | number | spin/StopPlanner.ts:98 |
duration | number | spin/StopPlanner.ts:98 |
turns | number | spin/StopPlanner.ts:98 |