Module pix_engine::math

source ·
Expand description

Math functions and constants.

Constants

Euler’s number (e)
1/sqrt(2)
2/sqrt(π)
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.