Math
Math utility functions
Properties
Methods
value — Value to be clamped.
min — Minimum value
max — Maximum value.
Clamps the value to be between min and max.
x — Value to be mapped.
a1 — Minimum value for range A.
a2 — Maximum value for range A.
b1 — Minimum value for range B.
b2 — Maximum value for range B.
Linear mapping of x from range [a1, a2] to range [b1, b2].
Random float from 0 to 1 with 16 bits of randomness.
Standard Math.random() creates repetitive patterns when applied over larger space.
Random integer from low to high interval.
Random float from low to high interval.
Random float from - range / 2 to range / 2 interval.
Converts degrees to radians.
Converts radians to degrees
x -- The value to evaluate based on its position between min and max.
min -- Any x value below min will be 0
max -- Any x value above max will be 1
Returns a value between 0-1 that represents the percentage that x has moved between min and max, but smoothed or slowed down the closer X is to the min and max.
Wikipedia
x -- The value to evaluate based on its position between min and max.
min -- Any x value below min will be 0
max -- Any x value above max will be 1
Returns a value between 0-1. It works the same as smoothstep, but more smooth.
Source
src/math/Math.js
Edit