pixi-wheels

pickTurns()

pixi-wheels


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#

ParameterType
basenumber
slopenumber
speednumber
profileSpinProfile

Returns#

{
  distance: number;
  duration: number;
  turns: number;
}
NameTypeDefined in
distancenumberspin/StopPlanner.ts:98
durationnumberspin/StopPlanner.ts:98
turnsnumberspin/StopPlanner.ts:98