Math
Helper functions that have to do with math.
Functions
Section titled “Functions”clamp()
Section titled “clamp()”function clamp(num, min, max): number;Defined in: functions/math.ts:13
Helper function to normalize a number, ensuring that it is within a certain range.
- If
numis less thanmin, then it will be clamped tomin. - If
numis greater thanmax, then it will be clamped tomax.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
num |
number |
min |
number |
max |
number |
Returns
Section titled “Returns”number
