Static extension of Float.

Static methods

staticinline beatToMillisecond (beat:Float, bpm:Float):Float

staticinline bezier (rate:Float, values:Array<Float>):Float

Bernstein polynomial, which is the mathematical basis for Bézier curve

staticinline bezier2 (rate:Float, from:Float, control:Float, to:Float):Float

Quadratic Bernstein polynomial

staticinline bezier3 (rate:Float, from:Float, control1:Float, control2:Float, to:Float):Float

Cubic Bernstein polynomial

staticinline binarySearch (sortedValues:Array<Float>, value:Float, boundaryMode:BoundaryMode = BoundaryMode.Low):Int

Parameters:

sortedValues

must be sorted

value
boundaryMode

Returns:

0 to sortedValues.length integer

staticinline clamp (value:Float, min:Float = 0.0, max:Float = 1.0):Float

staticinline connectEasing (time:Float, easing1:Float ‑> Float, easing2:Float ‑> Float, switchTime:Float = 0.5, switchValue:Float = 0.5):Float

staticinline cosByRate (rate:Float):Float

staticinline crossfadeEasing (rate:Float, easing1:Float ‑> Float, easing2:Float ‑> Float, easing2StrengthEasing:Float ‑> Float, easing2StrengthStart:Float = 0, easing2StrengthEnd:Float = 1):Float

Gradually changes to another easing at the beginning and at the end

staticinline degreeToRate (degree:Float):Float

staticinline frameToSecond (frame:Float, fps:Float):Float

staticinline inverseLerp (value:Float, from:Float, to:Float):Float

Normalizes a value within the range between from and to into a value between 0 and 1

staticinline lerp (rate:Float, from:Float, to:Float):Float

Linear interpolation between from and to by rate

staticinline millisecondToBeat (millisecond:Float, bpm:Float):Float

staticinline mixEasing (rate:Float, easing1:Float ‑> Float, easing2:Float ‑> Float, easing2Strength:Float = 0.5):Float

Intermediate easing between the two easings

staticinline oneTwoEasing (time:Float, easingOne:Float ‑> Float, easingTwo:Float ‑> Float, switchTime:Float = 0.5):Float

staticinline polyline (rate:Float, values:Array<Float>):Float

staticinline radianToRate (radian:Float):Float

staticinline rateToDegree (rate:Float):Float

staticinline rateToRadian (rate:Float):Float

staticinline repeat (value:Float, from:Float = 0.0, to:Float = 1.0):Float

staticinline revert (rate:Float):Float

same as 1 - rate

staticinline secondToFrame (second:Float, fps:Float):Float

staticinline shake (rate:Float, center:Float = 0.0, ?randomFunc:Void ‑> Float):Float

staticinline sinByRate (rate:Float):Float

staticinline spread (rate:Float, scale:Float):Float

same as FloatTools.lerp(rate, -scale, scale)

staticinline uniformQuadraticBSpline (rate:Float, values:Array<Float>):Float

Uniform Quadratic B-spline

staticinline yoyo (rate:Float, easing:Float ‑> Float):Float

Round trip motion that goes from 0.0 to 1.0 and returns to 0.0 in the reverse playback movement.

staticinline zigzag (rate:Float, easing:Float ‑> Float):Float

Round trip motion that goes from 0.0 to 1.0 and returns to 0.0 with the movement in which the moving direction is reversed.