# math

Namespace · category: Math

Source: https://github.com/playcanvas/engine/blob/b5b983982a9860d21e0c1dafb2f85f72e2c01afb/src/core/math/math.js#L7

Math API.

## Members

- [DEG_TO_RAD](https://api.playcanvas.com/engine/variables/math.DEG_TO_RAD.md): Conversion factor between degrees and radians.
- [RAD_TO_DEG](https://api.playcanvas.com/engine/variables/math.RAD_TO_DEG.md): Conversion factor between radians and degrees.
- [bytesToInt24](https://api.playcanvas.com/engine/functions/math.bytesToInt24.md): Convert 3 8 bit Numbers into a single unsigned 24 bit Number.
- [bytesToInt32](https://api.playcanvas.com/engine/functions/math.bytesToInt32.md): Convert 4 1-byte Numbers into a single unsigned 32bit Number.
- [clamp](https://api.playcanvas.com/engine/functions/math.clamp.md): Clamp a number between min and max inclusive.
- [intToBytes24](https://api.playcanvas.com/engine/functions/math.intToBytes24.md): Convert a 24-bit integer into an array of 3 bytes.
- [intToBytes32](https://api.playcanvas.com/engine/functions/math.intToBytes32.md): Convert a 32-bit integer into an array of 4 bytes.
- [lerp](https://api.playcanvas.com/engine/functions/math.lerp.md): Calculates the linear interpolation of two numbers.
- [lerpAngle](https://api.playcanvas.com/engine/functions/math.lerpAngle.md): Calculates the linear interpolation of two angles ensuring that interpolation is correctly performed across the 360...
- [lerpUnclamped](https://api.playcanvas.com/engine/functions/math.lerpUnclamped.md): Calculates the unclamped linear interpolation of two numbers.
- [nearestPowerOfTwo](https://api.playcanvas.com/engine/functions/math.nearestPowerOfTwo.md): Returns the nearest (smaller or larger) power of 2 for the specified value.
- [nextPowerOfTwo](https://api.playcanvas.com/engine/functions/math.nextPowerOfTwo.md): Returns the next power of 2 for the specified value.
- [powerOfTwo](https://api.playcanvas.com/engine/functions/math.powerOfTwo.md): Returns true if argument is a power-of-two and false otherwise.
- [random](https://api.playcanvas.com/engine/functions/math.random.md): Return a pseudo-random number between min and max.
- [roundUp](https://api.playcanvas.com/engine/functions/math.roundUp.md): Rounds a number up to nearest multiple.
- [smootherstep](https://api.playcanvas.com/engine/functions/math.smootherstep.md): An improved version of the math.smoothstep function which has zero 1st and 2nd order derivatives at t=0 and t=1.
- [smoothstep](https://api.playcanvas.com/engine/functions/math.smoothstep.md): The function interpolates smoothly between two input values based on a third one that should be between the first two.
