Math
Helper functions that have to do with math.
Functions
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
| Parameter | Type |
|---|---|
num | number |
min | number |
max | number |
Returns
number