Math#rotateToAngle()

rotateToAngle(currentAngle, targetAngle, lerp) → {number} Rotates currentAngle towards targetAngle, taking the shortest rotation distance.The lerp argument is the amount to rotate by in this call. Parameters Name Type Argument Default Description currentAngle number The current angle, in radians. targetAngle number The target angle to rotate to, in radians. lerp number <optional> 0.05 The lerp value to add to the current angle. Returns number - The adjusted angle

Math#reverseAngle()

reverseAngle(angleRad) → {number} Reverses an angle. Parameters Name Type Description angleRad number The angle to reverse, in radians. Returns number - The reverse angle, in radians. Source code: math/Math.js (Line 466)

Math#radToDeg()

radToDeg(radians) → {number} Convert radians to degrees. Parameters Name Type Description radians number Angle in radians. Returns number - Angle in degrees Source code: math/Math.js (Line 1197)

Math#percent()

percent(a, b, base) → {number} Work out what percentage value a is of value b using the given base. Parameters Name Type Argument Default Description a number The value to work out the percentage for. b number The value you wish to get the percentage of. base number <optional> 0 The base value. Returns number - The percentage a is of b, between 0 and 1. Source code: math/Math.js (Line 1153)

Math#normalizeAngle()

normalizeAngle(angleRad) → {number} Normalizes an angle to the [0,2pi) range. Parameters Name Type Description angleRad number The angle to normalize, in radians. Returns number - The angle, fit within the [0,2pi] range, in radians. Source code: math/Math.js (Line 478)

Math#minSub()

minSub(value, amount, min) → {number} Subtracts the given amount from the value, but never lets the value go below the specified minimum. Parameters Name Type Description value number The base value. amount number The amount to subtract from the base value. min number The minimum the value is allowed to be. Returns number - The new value. Source code: math/Math.js (Line 506)

Math#minProperty()

minProperty() → {number} Variation of Math.min that can be passed a property and either an array of objects or the objects as parameters.It will find the lowest matching property value from the given objects. Returns number - The lowest value from those given. Source code: math/Math.js (Line 667)

Math#min()

min() → {number} Variation of Math.min that can be passed either an array of numbers or the numbers as parameters. Prefer the standard Math.min function when appropriate. Returns number - The lowest value from those given. Source code: math/Math.js (Line 603) See http://jsperf.com/math-s-min-max-vs-homemade

Math#maxProperty()

maxProperty() → {number} Variation of Math.max that can be passed a property and either an array of objects or the objects as parameters.It will find the largest matching property value from the given objects. Returns number - The largest value from those given. Source code: math/Math.js (Line 697)

Math#maxAdd()

maxAdd(value, amount, max) → {number} Adds the given amount to the value, but never lets the value go over the specified maximum. Parameters Name Type Description value number The value to add the amount to. amount number The amount to add to the value. max number The maximum the value is allowed to be. Returns number - The new value. Source code: math/Math.js (Line 491)