Module pix_engine::math
source · [−]Expand description
Math functions and constants.
Constants
Euler’s number (e)
1/π
1/sqrt(2)
2/π
2/sqrt(π)
π/2
π/3
π/4
π/6
π/8
ln(2)
ln(10)
log2(10)
log2(e)
log10(2)
log10(e)
Archimedes’ constant (π)
sqrt(2)
The full circle constant (τ)
Traits
Default floating-point number trait used math operations.
Default number trait used for objects and shapes.
Functions
Linear interpolates between two values by a given amount.
Linear interpolates values for a range of independent values based on depdendent values.
Remaps a number from one range to another.
Returns the Perlin noise value at specified coordinates.
Returns a random number between 0
and a given value
.
Returns a random number within a range.