Math utility functions.
Global instance of a 2x2 identity matrix. Use as read-only.
Global instance of an identity transform. Use as read-only.
Global instance of a zero'ed vector. Use as read-only.
Creates an ABS number.
Number to ABS.
number
Absolute value of a.
Creates an ABS matrix.
Matrix to ABS all values.
Matrix with all positive values.
Creates an ABS vector.
Vector to ABS all values.
Vector with all positive values.
Adds two vectors.
a + b.
Clamp a number to the range of low to high.
Number to clamp.
Low range.
High range.
number
Number a clamped to range of low to high.
Clamps a vector to the range of low to high.
Vector a clamped to range of low to high.
Cross product of s and vector 2.
s value.
Vector 2 to use in cross product.
Cross product of s and a.
Cross product of vector 2 and s.
Vector 2 to use in cross product.
s value.
Cross product of a and s.
Cross product of two vector 2s.
number
Cross product of a and b.
Calculates the distance between two vectors.
number
Distance between a and b.
Calculates the squared distance between two vectors.
number
dist^2 between a and b.
Dot product of two vector 2s.
number
Dot product of a and b.
Check if a number is a power of 2.
Number to check if it is a power of 2.
boolean
True if x is a power of 2, otherwise false.
Determines if a number is valid. A number is valid if it is finite.
Number to check for validity.
boolean
True if x is valid, otherwise false.
Determines the max number.
First number.
Second number.
number
a or b depending on which is the maximum.
Determines the max vector.
a or b depending on which is the maximum.
Determines the minimum number.
First number.
Second number.
number
a or b depending on which is the minimum.
Determines the minimum vector.
a or b depending on which is the minimum.
Multiply matrix and vector.
Result.
Calculates the next power of 2 after the given number.
Number to start search for the next power of 2.
number
The next number that is a power of 2.
Generates a random number.
number
Returns a random number between lo and hi.
Lowest random number.
Highest random number.
number
Number between lo and hi.
Subtracts two vectors.
a - b.
Swaps a and b objects.
a -> b.
b -> a.