Module math

Source
Expand description

Math types and traits used by the crate.

Most of the math types are feature-dependent, so they will be different for 2d/3d and f32/f64.

Constants§

DIM
The active dimension.
FRAC_1_SQRT_2
1/sqrt(2)
FRAC_PI_2
The PI/2 constant.
PI
The PI constant.
TAU
The TAU constant.

Traits§

AdjustPrecision
Adjust the precision of the math construct to the precision chosen for compilation.
AsF32
Adjust the precision down to f32 regardless of compilation.
MatExt
An extension trait for matrix types.
RecipOrZero
An extension trait for computing reciprocals without division by zero.

Functions§

orthonormal_basis
Computes the rotation matrix of the orthonormal basis computed from the given axes.
orthonormal_basis_from_vec
Computes the rotation matrix of the orthonormal basis computed from the given axis.

Type Aliases§

Matrix
The dimension-specific matrix type used by Avian.
Matrix2
The 2x2 matrix type used by Avian.
Matrix3
The 3x3 matrix type used by Avian.
Quaternion
The quaternion type used by Avian.
Scalar
The floating point number type used by Avian.
SymmetricMatrix
The dimension-specific matrix type used by Avian.
SymmetricMatrix2
The 2x2 matrix type used by Avian.
SymmetricMatrix3
The 3x3 matrix type used by Avian.
Vector
The vector type used by Avian.
Vector2
The vector type used by Avian. This is always a 2D vector regardless of the chosen dimension.
Vector3
The vector type used by Avian. This is always a 3D vector regardless of the chosen dimension.