Module rin::math[][src]

Modules

allocator

Abstract definition of a matrix data storage allocator.

balancing

Functions for balancing a matrix.

core

[Reexported at the root of this crate.] Data structures for vector and matrix computations.

default_allocator

The default matrix data storage allocator.

dimension

Traits and tags for identifying the dimension of all algebraic entities.

geometry

[Reexported at the root of this crate.] Data structures for points and usual transformations (rotations, isometries, etc.)

givens

Construction of givens rotations.

linalg

[Reexported at the root of this crate.] Factorization of real matrices.

storage

Abstract definition of a matrix data storage.

traits

Macros

pnt2
pnt3
pnt4
vec2
vec3
vec4

Structs

Additive

The addition operator, commonly symbolized by +.

Deg
FullPivLU

LU decomposition with full row and column pivoting.

Id

The universal identity element wrt. a given operator, usually noted Id with a context-dependent subscript.

LU

LU decomposition with partial (row) pivoting.

Matrix

The most generic column-major matrix (and vector) type.

Multiplicative

The multiplication operator, commonly symbolized by ×.

Orthographic3

A 3D orthographic projection stored as an homogeneous 4x4 matrix.

Polyline
QR

The QR decomposition of a general matrix.

Quaternion

A quaternion. See the type alias UnitQuaternion = Unit<Quaternion> for a quaternion that may be used as a rotation.

Rad
Rect
Rotation

A rotation matrix.

Similarity

A similarity, i.e., an uniform scaling, followed by a rotation, followed by a translation.

SymmetricEigen

Eigendecomposition of a symmetric matrix.

SymmetricTridiagonal

Tridiagonalization of a symmetric matrix.

Translation

A translation.

U7
U9
U21
U26
U32
U36
U38
U40
U42
U54
U73
U74
U76
U79
U80
U86
U88
U98
U102
U103
U113
U118
U127
Unit

A wrapper that ensures the underlying algebraic entity has a unit norm.

Enums

RotOrder
TAffine

Tag representing an affine Transform. Its bottom-row is equal to (0, 0 ... 0, 1).

Traits

Angle
AsMat
AsPnt
AsVec
BaseInt
BaseNum
DimAdd
DimMin
DimMul
DimName

Trait implemented exclusively by type-level integers.

FastDot
FastInverse
FastMul
FloatPnt

Trait of vector with components implementing the BaseFloat trait.

FloatVec

Trait of vector with components implementing the BaseFloat trait.

Identity

A type that is equipped with identity.

InsidePolygon
InsideRect
IsNotStaticOne

Trait implemented by Dynamic and type-level integers different from U1.

NumPnt

Trait grouping most common operations on vectors.

NumVec

Trait grouping most common operations on vectors.

Real

Trait shared by all reals.

Scalar

The basic scalar type for all structures of nalgebra.

SuperTCategoryOf

Indicates that Self is a more general Transform category than Other.

Swizzles2
Swizzles3
Swizzles4
Swizzles2Mut
Swizzles3Mut
Swizzles4Mut
TCategory

Trait implemented by phantom types identifying the projective transformation type.

ToMat
ToPnt
ToVec

Functions

abs

The absolute value of a.

add_translation
angle

Computes the smallest angle between two vectors.

angle_cast
atan2
bezier_interpolate
center

The center of two points.

clamp

Returns a reference to the input value clamped to the interval [min, max].

convert

Converts an object from one type to an equivalent or more general one.

convert_ref

Converts an object from one type to an equivalent or more general one.

convert_ref_unchecked

Use with care! Same as try_convert but without any property checks.

convert_unchecked

Use with care! Same as try_convert but without any property checks.

dimension

The dimension of the given algebraic entity seen as a vector space.

distance

The distance between two points.

distance_squared

The squared distance between two points.

dot

Computes the dot product of two vectors.

euler_to_quaternion
id

Gets the ubiquitous multiplicative identity element.

inf

Returns the infimum of a and b.

inf_sup

Returns simultaneously the infimum and supremum of a and b.

inverse

Computes the multiplicative inverse of an (always invertible) algebraic entity.

is_convertible

Indicates if ::try_convert will succeed without actually performing the conversion.

lerp
line_segment_intersection
magnitude

A synonym function for norm() aka length.

magnitude_squared

A synonym function for norm_squared() aka length squared.

map
map_clamp
max

Same as cmp::max.

min

Same as cmp::min.

next_pow2
norm

Computes the L2 (euclidean) norm of a vector.

norm_squared

Computes the squared L2 (euclidean) norm of the vector v.

normalize

Computes the normalized version of the vector v.

one

Gets the multiplicative identity element.

origin

Gets the origin of the given point.

partial_clamp

Clamp value between min and max. Returns None if value is not comparable to min or max.

partial_cmp

Compare a and b using a partial ordering relation.

partial_ge

Returns true iff a and b are comparable and a >= b.

partial_gt

Returns true iff a and b are comparable and a > b.

partial_le

Returns true iff a and b are comparable and a <= b.

partial_lt

Returns true iff a and b are comparable and a < b.

partial_max

Return the maximum of a and b if they are comparable.

partial_min

Return the minimum of a and b if they are comparable.

partial_sort2

Sorts two values in increasing order using a partial ordering.

pnt2
pnt3
pnt4
pnt5
pnt6
sup

Returns the supremum of a and b.

to_euler
to_tait_bryan
try_convert

Attempts to convert an object to a more specific one.

try_convert_ref

Attempts to convert an object to a more specific one.

try_inverse

Tries to gets an inverted copy of a square matrix.

try_invert_to

Performs a LU decomposition to overwrite out with the inverse of matrix.

try_normalize

Computes the normalized version of the vector v or returns None if its norm is smaller than min_norm.

vec2
vec3
vec4
vec5
vec6
wilkinson_shift

Computes the wilkinson shift, i.e., the 2x2 symmetric matrix eigenvalue to its tailing component tnn.

wrap

Wraps val into the range [min, max] using modular arithmetics.

wrap
zero

Gets the additive identity element.

Type Definitions

DVector

A dynamically sized column vector.

DVectorSlice

A column vector slice dynamic numbers of rows and columns.

DVectorSliceMut

A mutable column vector slice dynamic numbers of rows and columns.

DimProd
Isometry3

A 3-dimensional direct isometry using a unit quaternion for its rotational part.

IsometryMatrix2

A 2-dimensional direct isometry using a rotation matrix for its rotational part.

IsometryMatrix3

A 3-dimensional direct isometry using a rotation matrix for its rotational part.

Mat1
Mat2
Mat3
Mat4
Mat5
Mat6
Matrix2

A stack-allocated, column-major, 2x2 square matrix.

Matrix3

A stack-allocated, column-major, 3x3 square matrix.

Matrix5

A stack-allocated, column-major, 5x5 square matrix.

Matrix1x3

A stack-allocated, column-major, 1x3 matrix.

Matrix2x1

A stack-allocated, column-major, 2x1 matrix.

Matrix2x3

A stack-allocated, column-major, 2x3 matrix.

Matrix2x6

A stack-allocated, column-major, 2x6 matrix.

Matrix3x6

A stack-allocated, column-major, 3x6 matrix.

Matrix4x1

A stack-allocated, column-major, 4x1 matrix.

Matrix4x3

A stack-allocated, column-major, 4x3 matrix.

Matrix4x5

A stack-allocated, column-major, 4x5 matrix.

Matrix5x1

A stack-allocated, column-major, 5x1 matrix.

Matrix5x3

A stack-allocated, column-major, 5x3 matrix.

Matrix5x4

A stack-allocated, column-major, 5x4 matrix.

Matrix6x2

A stack-allocated, column-major, 6x2 matrix.

Matrix6x4

A stack-allocated, column-major, 6x4 matrix.

MatrixCross

The type of the result of a matrix cross product.

MatrixSlice1

A column-major 1x1 matrix slice.

MatrixSlice5

A column-major 5x5 matrix slice.

MatrixSlice1x3

A column-major 1x3 matrix slice.

MatrixSlice1x4

A column-major 1x4 matrix slice.

MatrixSlice1x6

A column-major 1x6 matrix slice.

MatrixSlice1xX

A column-major matrix slice with 1 row and a number of columns chosen at runtime.

MatrixSlice2x5

A column-major 2x5 matrix slice.

MatrixSlice2x6

A column-major 2x6 matrix slice.

MatrixSlice3x1

A column-major 3x1 matrix slice.

MatrixSlice3x2

A column-major 3x2 matrix slice.

MatrixSlice3x6

A column-major 3x6 matrix slice.

MatrixSlice4x3

A column-major 4x3 matrix slice.

MatrixSlice4x5

A column-major 4x5 matrix slice.

MatrixSlice4xX

A column-major matrix slice with 4 rows and a number of columns chosen at runtime.

MatrixSlice5x1

A column-major 5x1 matrix slice.

MatrixSlice5x2

A column-major 5x2 matrix slice.

MatrixSlice5x6

A column-major 5x6 matrix slice.

MatrixSlice5xX

A column-major matrix slice with 5 rows and a number of columns chosen at runtime.

MatrixSlice6x3

A column-major 6x3 matrix slice.

MatrixSlice6x4

A column-major 6x4 matrix slice.

MatrixSliceMN

A column-major matrix slice with R rows and C columns.

MatrixSliceMut

A matrix slice.

MatrixSliceMut4

A column-major 4x4 mutable matrix slice.

MatrixSliceMut1x6

A column-major 1x6 mutable matrix slice.

MatrixSliceMut1xX

A column-major mutable matrix slice with 1 row and a number of columns chosen at runtime.

MatrixSliceMut2x3

A column-major 2x3 mutable matrix slice.

MatrixSliceMut2x5

A column-major 2x5 mutable matrix slice.

MatrixSliceMut3x1

A column-major 3x1 mutable matrix slice.

MatrixSliceMut3x5

A column-major 3x5 mutable matrix slice.

MatrixSliceMut3x6

A column-major 3x6 mutable matrix slice.

MatrixSliceMut3xX

A column-major mutable matrix slice with 3 rows and a number of columns chosen at runtime.

MatrixSliceMut4x2

A column-major 4x2 mutable matrix slice.

MatrixSliceMut4x3

A column-major 4x3 mutable matrix slice.

MatrixSliceMut4xX

A column-major mutable matrix slice with 4 rows and a number of columns chosen at runtime.

MatrixSliceMut5x1

A column-major 5x1 mutable matrix slice.

MatrixSliceMut5x2

A column-major 5x2 mutable matrix slice.

MatrixSliceMut5x4

A column-major 5x4 mutable matrix slice.

MatrixSliceMut5x6

A column-major 5x6 mutable matrix slice.

MatrixSliceMut6xX

A column-major mutable matrix slice with 6 rows and a number of columns chosen at runtime.

MatrixSliceMutXx1

A column-major mutable matrix slice with a number of rows chosen at runtime and 1 column.

MatrixSliceMutXx4

A column-major mutable matrix slice with a number of rows chosen at runtime and 4 columns.

MatrixSliceMutXx5

A column-major mutable matrix slice with a number of rows chosen at runtime and 5 columns.

MatrixSliceMutXx6

A column-major mutable matrix slice with a number of rows chosen at runtime and 6 columns.

MatrixSliceXx1

A column-major matrix slice with a number of rows chosen at runtime and 1 column.

MatrixSliceXx2

A column-major matrix slice with a number of rows chosen at runtime and 2 columns.

MatrixSliceXx4

A column-major matrix slice with a number of rows chosen at runtime and 4 columns.

MatrixSliceXx5

A column-major matrix slice with a number of rows chosen at runtime and 5 columns.

MatrixSliceXx6

A column-major matrix slice with a number of rows chosen at runtime and 6 columns.

Pnt1
Pnt2
Pnt3
Pnt4
Pnt5
Pnt6
Point2

A statically sized 2-dimensional column point.

Point3

A statically sized 3-dimensional column point.

Point5

A statically sized 5-dimensional column point.

Projective2

An inversible 2D general transformation. Stored as an homogeneous 3x3 matrix.

Projective3

An inversible 3D general transformation. Stored as an homogeneous 4x4 matrix.

Quat
RowDVector

A dynamically sized row vector.

RowVector

A matrix with one row and D columns .

RowVector1

A stack-allocated, 1-dimensional row vector.

RowVector2

A stack-allocated, 2-dimensional row vector.

RowVector3

A stack-allocated, 3-dimensional row vector.

Similarity3

A 3-dimensional similarity.

SimilarityMatrix2

A 2-dimensional similarity using a rotation matrix for its rotation part.

SquareMatrix

A square matrix.

Transform2

A 2D general transformation that may not be inversible. Stored as an homogeneous 3x3 matrix.

Transform3

A 3D general transformation that may not be inversible. Stored as an homogeneous 4x4 matrix.

Translation2

A 2-dimensional translation.

UnitQuat
Vec1
Vec2
Vec3
Vec4
Vec5
Vec6
VecN
Vector

A matrix with one column and D rows.

Vector1

A stack-allocated, 1-dimensional column vector.

Vector3

A stack-allocated, 3-dimensional column vector.

Vector4

A stack-allocated, 4-dimensional column vector.

Vector6

A stack-allocated, 6-dimensional column vector.

VectorN

A statically sized D-dimensional column vector.

VectorSlice1

A 1D column vector slice.

VectorSliceMut1

A 1D mutable column vector slice.

VectorSliceMut3

A 3D mutable column vector slice.

VectorSliceMut5

A 5D mutable column vector slice.