Struct nalgebra::geometry::Rotation

source ·
#[repr(C)]
pub struct Rotation<N: Scalar, D: DimName>where
    DefaultAllocator: Allocator<N, D, D>,
{ /* private fields */ }
Expand description

A rotation matrix.

Implementations§

A reference to the underlying matrix representation of this rotation.

A mutable reference to the underlying matrix representation of this rotation.

This is unsafe because this allows the user to replace the matrix by another one that is non-square, non-inversible, or non-orthonormal. If one of those properties is broken, subsequent method calls may be UB.

Unwraps the underlying matrix.

Converts this rotation into its equivalent homogeneous transformation matrix.

Creates a new rotation from the given square matrix.

The matrix squareness is checked but not its orthonormality.

Transposes self.

Inverts self.

Transposes self in-place.

Inverts self in-place.

Creates a new square identity rotation of the given dimension.

Builds a 2 dimensional rotation matrix from an angle in radian.

Builds a 2 dimensional rotation matrix from an angle in radian wrapped in a 1-dimensional vector.

Equivalent to Self::new(axisangle[0]).

The rotation matrix required to align a and b but with its angle.

This is the rotation R such that (R * a).angle(b) == 0 && (R * a).dot(b).is_positive().

The smallest rotation needed to make a and b collinear and point toward the same direction, raised to the power s.

The rotation angle.

The rotation angle needed to make self and other coincide.

The rotation matrix needed to make self and other coincide.

The result is such that: self.rotation_to(other) * self == other.

Raise the quaternion to a given floating power, i.e., returns the rotation with the angle of self multiplied by n.

The rotation angle returned as a 1-dimensional vector.

Builds a 3 dimensional rotation matrix from an axis and an angle.

Arguments
  • axisangle - A vector representing the rotation. Its magnitude is the amount of rotation in radian. Its direction is the axis of rotation.

Builds a 3D rotation matrix from an axis scaled by the rotation angle.

Builds a 3D rotation matrix from an axis and a rotation angle.

Creates a new rotation from Euler angles.

The primitive rotations are applied in order: 1 roll − 2 pitch − 3 yaw.

Creates Euler angles from a rotation.

The angles are produced in the form (roll, yaw, pitch).

Creates a rotation that corresponds to the local frame of an observer standing at the origin and looking toward dir.

It maps the view direction dir to the positive z axis.

Arguments
  • dir - The look direction, that is, direction the matrix z axis will be aligned with.
  • up - The vertical direction. The only requirement of this parameter is to not be collinear to dir. Non-collinearity is not checked.

Builds a right-handed look-at view matrix without translation.

This conforms to the common notion of right handed look-at matrix from the computer graphics community.

Arguments
  • eye - The eye position.
  • target - The target position.
  • up - A vector approximately aligned with required the vertical axis. The only requirement of this parameter is to not be collinear to target - eye.

Builds a left-handed look-at view matrix without translation.

This conforms to the common notion of left handed look-at matrix from the computer graphics community.

Arguments
  • eye - The eye position.
  • target - The target position.
  • up - A vector approximately aligned with required the vertical axis. The only requirement of this parameter is to not be collinear to target - eye.

The rotation matrix required to align a and b but with its angle.

This is the rotation R such that (R * a).angle(b) == 0 && (R * a).dot(b).is_positive().

The smallest rotation needed to make a and b collinear and point toward the same direction, raised to the power s.

The rotation angle.

The rotation axis. Returns None if the rotation angle is zero or PI.

The rotation axis multiplied by the rotation angle.

The rotation angle needed to make self and other coincide.

The rotation matrix needed to make self and other coincide.

The result is such that: self.rotation_to(other) * self == other.

Raise the quaternion to a given floating power, i.e., returns the rotation with the same axis as self and an angle equal to self.angle() multiplied by n.

Trait Implementations§

Used for specifying relative comparisons.
The default tolerance to use when testing values that are close together. Read more
A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more
The inverse of ApproxEq::abs_diff_eq.
Performs an operation.
Performs specific operation.
Checks whether operating with the identity element is a no-op for the given argument. Approximate equality is used for verifications. Read more
Returns true if latin squareness holds for the given arguments. Approximate equality is used for verifications. Read more
Returns true if associativity holds for the given arguments. Approximate equality is used for verifications. Read more
Type of the first rotation to be applied.
Type of the non-uniform scaling to be applied.
The type of the pure translation part of this affine transformation.
Decomposes this affine transformation into a rotation followed by a non-uniform scaling, followed by a rotation, followed by a translation. Read more
Appends a translation to this similarity.
Prepends a translation to this similarity.
Appends a rotation to this similarity.
Prepends a rotation to this similarity.
Appends a scaling factor to this similarity.
Prepends a scaling factor to this similarity.
Appends to this similarity a rotation centered at the point p, i.e., this point is left invariant. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more

Generate a uniformly distributed random rotation.

Create an iterator that generates random values of T, using rng as the source of randomness. Read more

Generate a uniformly distributed random rotation.

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
The identity element.
Specific identity.
The returned type after indexing.
Performs the indexing (container[index]) operation. Read more
Returns the inverse of self, relative to the operator O.
In-place inversin of self.
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Returns the multiplicative identity element of Self, 1. Read more
Sets self to the multiplicative identity element of Self, 1.
Returns true if self is equal to the multiplicative identity. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Applies this group’s inverse action on a point from the euclidean space.
Applies this group’s inverse action on a vector from the euclidean space. Read more
The default relative tolerance for testing values that are far-apart. Read more
A test for equality that uses a relative comparison if the values are far apart.
The inverse of ApproxEq::relative_eq.

Subgroups of the n-dimensional rotation group SO(n).

Raises this rotation to a power. If this is a simple rotation, the result must be equivalent to multiplying the rotation angle by n. Read more
Computes a simple rotation that makes the angle between a and b equal to zero, i.e., b.angle(a * delta_rotation(a, b)) = 0. If a and b are collinear, the computed rotation may not be unique. Returns None if no such simple rotation exists in the subgroup represented by Self. Read more
Computes the rotation between a and b and raises it to the power n. Read more
The type of the pure (uniform) scaling part of this similarity transformation.
The pure translational component of this similarity transformation.
The pure rotational component of this similarity transformation.
The pure scaling component of this similarity transformation.
Applies this transformation’s pure translational part to a point.
Applies this transformation’s pure rotational part to a point.
Applies this transformation’s pure scaling part to a point.
Applies this transformation’s pure rotational part to a vector.
Applies this transformation’s pure scaling part to a vector.
Applies this transformation inverse’s pure translational part to a point.
Applies this transformation inverse’s pure rotational part to a point.
Applies this transformation inverse’s pure scaling part to a point.
Applies this transformation inverse’s pure rotational part to a vector.
Applies this transformation inverse’s pure scaling part to a vector.
The inclusion map: converts self to the equivalent element of its superset.
Checks if element is actually part of the subset Self (and can be converted to it).
Use with care! Same as self.to_superset but without any property checks. Always succeeds.
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
The inclusion map: converts self to the equivalent element of its superset.
Checks if element is actually part of the subset Self (and can be converted to it).
Use with care! Same as self.to_superset but without any property checks. Always succeeds.
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
The inclusion map: converts self to the equivalent element of its superset.
Checks if element is actually part of the subset Self (and can be converted to it).
Use with care! Same as self.to_superset but without any property checks. Always succeeds.
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
The inclusion map: converts self to the equivalent element of its superset.
Checks if element is actually part of the subset Self (and can be converted to it).
Use with care! Same as self.to_superset but without any property checks. Always succeeds.
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
The inclusion map: converts self to the equivalent element of its superset.
Checks if element is actually part of the subset Self (and can be converted to it).
Use with care! Same as self.to_superset but without any property checks. Always succeeds.
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
The inclusion map: converts self to the equivalent element of its superset.
Checks if element is actually part of the subset Self (and can be converted to it).
Use with care! Same as self.to_superset but without any property checks. Always succeeds.
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
The inclusion map: converts self to the equivalent element of its superset.
Checks if element is actually part of the subset Self (and can be converted to it).
Use with care! Same as self.to_superset but without any property checks. Always succeeds.
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Applies this group’s action on a point from the euclidean space.
Applies this group’s action on a vector from the euclidean space. Read more
The default ULPs to tolerate when testing values that are far-apart. Read more
A test for equality that uses units in the last place (ULP) if the values are far apart.
The inverse of ApproxEq::ulps_eq.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

👎Deprecated since 0.5.0: replaced by distributions::Standard
Generates a random instance of this type using the specified source of randomness. Read more
Should always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.