Expand description
The scalar and vector primitives the rest of the vocabulary is built from:
the f32 transcendentals core leaves to a math library, and the
3-component vector ops every layout and transform reaches for.
Modules§
- vec3
- The crate’s shared 3-component vector math. Every module that needs a dot, cross, or component-wise op reaches for these rather than redeclaring them.
Functions§
- acos
- Arc cosine, in radians.
- asin
- Arc sine, in radians.
- atan2
- Arc tangent of
y / x, in radians, using both signs to pick the quadrant. - ceil
- Smallest integer at or above
x. - cos
- Cosine of an angle in radians.
- exp
eraised tox.- exp2
- 2 raised to
x. - floor
- Largest integer at or below
x. - fract
- Fractional part, keeping the sign of
x. - hypot
- Length of the hypotenuse of a right triangle with legs
xandy, without the intermediate overflow ofsqrt(x * x + y * y). - ln
- Natural logarithm.
- log2
- Base-2 logarithm.
- mul_add
x * y + zwith a single rounding.- powf
xraised ton.- powi
xraised to the integer powern, by squaring. Matches the expansionf32::powilowers to rather than routing throughpowf, which would round differently.- rem_
euclid - Least nonnegative remainder of
x (mod rhs). - round
- Nearest integer, with halves rounded away from zero.
- sin
- Sine of an angle in radians.
- sin_cos
- Sine and cosine of an angle in radians.
- sqrt
- Square root.
- tan
- Tangent of an angle in radians.
- trunc
- Integer part, discarding the fraction and keeping the sign of
x.