[][src]Module rin::math

This module mostly re-exports na (a graphics oriented wrapper for nalgebra) angle (a type safe wrapper for angle measseures) and adds a few simple functions useful for graphics math

Modules

base

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

constraint

Compatibility constraints between matrix shapes, e.g., for addition or multiplication.

coordinates

Structures to which matrices and vector can be auto-dereferenced (through Deref) to access components using their names. For example, if v is a 3D vector, one can write v.z instead of v[2].

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.

iter

Matrix iterators.

linalg

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

traits

Macros

pnt2
pnt3
pnt4
vec2
vec3
vec4

Structs

Additive

The addition operator, commonly symbolized by +.

ArrayStorage

A array-based statically sized matrix data storage.

Bidiagonal

The bidiagonalization of a general matrix.

Cholesky

The Cholesky decomposition of a symmetric-definite-positive matrix.

Deg
Id

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

LU

LU decomposition with partial (row) pivoting.

Multiplicative

The multiplication operator, commonly symbolized by ×.

Polyline

An open or closed collection of vertices that represents a polyline or polygon

Rad
Rect

Represents a rectangle with operations over it

SliceStorage

A matrix data storage for a matrix slice. Only contains an internal reference to another matrix data storage.

SliceStorageMut

A mutable matrix data storage for mutable matrix slice. Only contains an internal mutable reference to another matrix data storage.

SymmetricTridiagonal

Tridiagonalization of a symmetric matrix.

Transform

A transformation matrix in homogeneous coordinates.

U2

A type level dimension.

U6

A type level dimension.

U7

A type level dimension.

U15

A type level dimension.

U27

A type level dimension.

U38

A type level dimension.

U49

A type level dimension.

U60

A type level dimension.

U76

A type level dimension.

U97

A type level dimension.

U98

A type level dimension.

U108

A type level dimension.

U124

A type level dimension.

U125

A type level dimension.

VecStorage

A Vec-based matrix data storage. It may be dynamically-sized.

Enums

RotOrder
TGeneral

Tag representing the most general (not necessarily inversible) Transform type.

Traits

Angle
AsMat
AsPnt
AsVec
BaseInt
BaseNum
Dim

Trait implemented by any type that can be used as a dimension. This includes type-level integers and Dynamic (for dimensions not known at compile-time).

DimNameDiv
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

Trait to check if a point is inside a polygon

InsideRect

Trait to calculate if something is inside a rectangle

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.

Swizzles2
Swizzles2Mut
Swizzles3
Swizzles3Mut
Swizzles4
Swizzles4Mut
TCategory

Trait implemented by phantom types identifying the projective transformation type.

TCategoryMul

Traits that gives the Transform category that is compatible with the result of the multiplication of transformations with categories Self and Other.

ToMat
ToPnt
ToVec

Functions

abs[
Deprecated
]

The absolute value of a.

add_translation

Adds a 3d translation to a Mat4

angle[
Deprecated
]

Computes the smallest angle between two vectors.

angle_cast
atan2
bezier_interpolate

Bezier interpolation from from to to using the control points cp1 and cp2 at the normalized distance pct

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[
Deprecated
]

Computes the dot product of two vectors.

euler_to_quaternion

Convert euler angles with a certain rotation order into a 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.

iwrap

Wrap an integer value in the range from..to

lerp

Linear interpolation

line_segment_intersection

Intersection of line segments p0 - p1 and p2 - p3

magnitude[
Deprecated
]

A synonym for norm, aka length.

magnitude_squared[
Deprecated
]

A synonym for norm_squared, aka length squared.

map

Map a value from an input range inmin..inmax to an output range outmin..outmax

map_clamp

Map a value from an input range inmin..inmax to an output range outmin..outmax and clamp the result to be inside the output range

max

Same as cmp::max.

min

Same as cmp::min.

next_multiple
next_pow2

Next power of two

norm[
Deprecated
]

Computes the L2 (Euclidean) norm of a vector.

norm_squared[
Deprecated
]

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

normalize[
Deprecated
]

Computes the normalized version of the vector v.

one

Gets the multiplicative identity element.

origin[
Deprecated
]

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

Convert a quaternion to euler angles

to_tait_bryan

Convert a quaternion to tait bryan angles

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_normalize[
Deprecated
]

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

Wrap a value in the range from..to

zero

Gets the additive identity element.

Type Definitions

DMatrixSlice

A column-major matrix slice dynamic numbers of rows and columns.

DMatrixSliceMut

A column-major mutable matrix slice dynamic numbers of rows and columns.

DVector

A dynamically sized column vector.

Isometry2
Isometry3
IsometryMatrix2

A 2-dimensional direct isometry using a rotation matrix for its rotational part. Also known as a rigid-body motion, or as an element of SE(2).

Mat1
Mat2
Mat3
Mat4
Mat5
Mat6
Matrix1

A stack-allocated, column-major, 1x1 square matrix.

Matrix2

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

Matrix3

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

Matrix6

A stack-allocated, column-major, 6x6 square matrix.

Matrix1x2

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

Matrix1x5

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

Matrix1x6

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

Matrix2x3

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

Matrix2x5

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

Matrix2x6

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

Matrix3x2

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

Matrix3x5

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

Matrix3x6

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

Matrix5x2

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

Matrix5x4

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

Matrix5x6

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

Matrix6x1

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

Matrix6x2

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

MatrixArray[
Deprecated
]

Renamed to [ArrayStorage].

MatrixCross

The type of the result of a matrix cross product.

MatrixMN

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

MatrixNM[
Deprecated
]

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

MatrixSlice1

A column-major 1x1 matrix slice.

MatrixSlice3

A column-major 3x3 matrix slice.

MatrixSlice3xX

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

MatrixSlice4

A column-major 4x4 matrix slice.

MatrixSlice4xX

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

MatrixSlice5

A column-major 5x5 matrix slice.

MatrixSlice1x2

A column-major 1x2 matrix slice.

MatrixSlice1x5

A column-major 1x5 matrix slice.

MatrixSlice1x6

A column-major 1x6 matrix slice.

MatrixSlice2x3

A column-major 2x3 matrix slice.

MatrixSlice2x4

A column-major 2x4 matrix slice.

MatrixSlice2x6

A column-major 2x6 matrix slice.

MatrixSlice3x1

A column-major 3x1 matrix slice.

MatrixSlice3x5

A column-major 3x5 matrix slice.

MatrixSlice3x6

A column-major 3x6 matrix slice.

MatrixSlice4x2

A column-major 4x2 matrix slice.

MatrixSlice4x6

A column-major 4x6 matrix slice.

MatrixSlice5x1

A column-major 5x1 matrix slice.

MatrixSlice5x2

A column-major 5x2 matrix slice.

MatrixSlice5x3

A column-major 5x3 matrix slice.

MatrixSlice5x6

A column-major 5x6 matrix slice.

MatrixSlice6x2

A column-major 6x2 matrix slice.

MatrixSlice6x5

A column-major 6x5 matrix slice.

MatrixSliceMN

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

MatrixSliceMut

A matrix slice.

MatrixSliceMut1

A column-major 1x1 mutable matrix slice.

MatrixSliceMut2

A column-major 2x2 mutable matrix slice.

MatrixSliceMut3

A column-major 3x3 mutable matrix slice.

MatrixSliceMut3xX

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

MatrixSliceMut4

A column-major 4x4 mutable matrix slice.

MatrixSliceMut6

A column-major 6x6 mutable matrix slice.

MatrixSliceMut6xX

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

MatrixSliceMut1x2

A column-major 1x2 mutable matrix slice.

MatrixSliceMut1x4

A column-major 1x4 mutable matrix slice.

MatrixSliceMut1x5

A column-major 1x5 mutable matrix slice.

MatrixSliceMut2x6

A column-major 2x6 mutable matrix slice.

MatrixSliceMut3x1

A column-major 3x1 mutable matrix slice.

MatrixSliceMut3x4

A column-major 3x4 mutable matrix slice.

MatrixSliceMut3x5

A column-major 3x5 mutable matrix slice.

MatrixSliceMut4x1

A column-major 4x1 mutable matrix slice.

MatrixSliceMut4x2

A column-major 4x2 mutable matrix slice.

MatrixSliceMut4x6

A column-major 4x6 mutable matrix slice.

MatrixSliceMut5x1

A column-major 5x1 mutable matrix slice.

MatrixSliceMut5x3

A column-major 5x3 mutable matrix slice.

MatrixSliceMut5x6

A column-major 5x6 mutable matrix slice.

MatrixSliceMut6x1

A column-major 6x1 mutable matrix slice.

MatrixSliceMut6x4

A column-major 6x4 mutable matrix slice.

MatrixSliceMutXx1

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

MatrixSliceMutXx3

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

MatrixSliceXx1

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

MatrixSliceXx4

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

Pnt1
Pnt2
Pnt3
Pnt4
Pnt5
Pnt6
Point1

A statically sized 1-dimensional column point.

Projective2

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

Projective3

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

Quat
Rotation2
Rotation3
RowDVector

A dynamically sized row vector.

RowVector

A matrix with one row and D columns .

RowVector1

A stack-allocated, 1-dimensional row vector.

RowVector3

A stack-allocated, 3-dimensional row vector.

RowVector4

A stack-allocated, 4-dimensional row vector.

RowVector6

A stack-allocated, 6-dimensional row vector.

Similarity3

A 3-dimensional similarity.

SimilarityMatrix2

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

Translation2
Translation3
UnitQuat
Vec1
Vec2
Vec3
Vec4
Vec5
Vec6
VecN
Vector

A matrix with one column and D rows.

Vector2

A stack-allocated, 2-dimensional column vector.

Vector4

A stack-allocated, 4-dimensional column vector.

Vector5

A stack-allocated, 5-dimensional column vector.

VectorSlice1

A 1D column vector slice.

VectorSlice2

A 2D column vector slice.

VectorSlice3

A 3D column vector slice.

VectorSlice5

A 5D column vector slice.

VectorSlice6

A 6D column vector slice.

VectorSliceMut1

A 1D mutable column vector slice.

VectorSliceMut2

A 2D mutable column vector slice.

VectorSliceMut4

A 4D mutable column vector slice.

VectorSliceMut5

A 5D mutable column vector slice.

VectorSliceMut6

A 6D mutable column vector slice.