nalgebra::geometry

Type Alias Rotation2

Source
pub type Rotation2<T> = Rotation<T, 2>;
Expand description

A 2-dimensional rotation matrix.

Because this is an alias, not all its methods are listed here. See the Rotation type too.

Aliased Type§

struct Rotation2<T> { /* private fields */ }

Implementations§

Source§

impl<T: SimdRealField> Rotation2<T>

§Interpolation

Source

pub fn slerp(&self, other: &Self, t: T) -> Self

Spherical linear interpolation between two rotation matrices.

§Examples:

let rot1 = Rotation2::new(std::f32::consts::FRAC_PI_4);
let rot2 = Rotation2::new(-std::f32::consts::PI);

let rot = rot1.slerp(&rot2, 1.0 / 3.0);

assert_relative_eq!(rot.angle(), std::f32::consts::FRAC_PI_2);
Source§

impl<T: SimdRealField> Rotation2<T>

§Construction from a 2D rotation angle

Source

pub fn new(angle: T) -> Self

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

§Example
let rot = Rotation2::new(f32::consts::FRAC_PI_2);

assert_relative_eq!(rot * Point2::new(3.0, 4.0), Point2::new(-4.0, 3.0));
Source

pub fn from_scaled_axis<SB: Storage<T, U1>>( axisangle: Vector<T, U1, SB>, ) -> Self

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

This is generally used in the context of generic programming. Using the ::new(angle) method instead is more common.

Source§

impl<T: SimdRealField> Rotation2<T>

§Construction from an existing 2D matrix or rotations

Source

pub fn from_basis_unchecked(basis: &[Vector2<T>; 2]) -> Self

Builds a rotation from a basis assumed to be orthonormal.

In order to get a valid rotation matrix, the input must be an orthonormal basis, i.e., all vectors are normalized, and the are all orthogonal to each other. These invariants are not checked by this method.

Source

pub fn from_matrix(m: &Matrix2<T>) -> Self
where T: RealField,

Builds a rotation matrix by extracting the rotation part of the given transformation m.

This is an iterative method. See .from_matrix_eps to provide mover convergence parameters and starting solution. This implements “A Robust Method to Extract the Rotational Part of Deformations” by Müller et al.

Source

pub fn from_matrix_eps( m: &Matrix2<T>, eps: T, max_iter: usize, guess: Self, ) -> Self
where T: RealField,

Builds a rotation matrix by extracting the rotation part of the given transformation m.

This implements “A Robust Method to Extract the Rotational Part of Deformations” by Müller et al.

§Parameters
  • m: the matrix from which the rotational part is to be extracted.
  • eps: the angular errors tolerated between the current rotation and the optimal one.
  • max_iter: the maximum number of iterations. Loops indefinitely until convergence if set to 0.
  • guess: an estimate of the solution. Convergence will be significantly faster if an initial solution close to the actual solution is provided. Can be set to Rotation2::identity() if no other guesses come to mind.
Source

pub fn rotation_between<SB, SC>( a: &Vector<T, U2, SB>, b: &Vector<T, U2, SC>, ) -> Self
where T: RealField, SB: Storage<T, U2>, SC: Storage<T, U2>,

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().

§Example
let a = Vector2::new(1.0, 2.0);
let b = Vector2::new(2.0, 1.0);
let rot = Rotation2::rotation_between(&a, &b);
assert_relative_eq!(rot * a, b);
assert_relative_eq!(rot.inverse() * b, a);
Source

pub fn scaled_rotation_between<SB, SC>( a: &Vector<T, U2, SB>, b: &Vector<T, U2, SC>, s: T, ) -> Self
where T: RealField, SB: Storage<T, U2>, SC: Storage<T, U2>,

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

§Example
let a = Vector2::new(1.0, 2.0);
let b = Vector2::new(2.0, 1.0);
let rot2 = Rotation2::scaled_rotation_between(&a, &b, 0.2);
let rot5 = Rotation2::scaled_rotation_between(&a, &b, 0.5);
assert_relative_eq!(rot2 * rot2 * rot2 * rot2 * rot2 * a, b, epsilon = 1.0e-6);
assert_relative_eq!(rot5 * rot5 * a, b, epsilon = 1.0e-6);
Source

pub fn rotation_to(&self, other: &Self) -> Self

The rotation matrix needed to make self and other coincide.

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

§Example
let rot1 = Rotation2::new(0.1);
let rot2 = Rotation2::new(1.7);
let rot_to = rot1.rotation_to(&rot2);

assert_relative_eq!(rot_to * rot1, rot2);
assert_relative_eq!(rot_to.inverse() * rot2, rot1);
Source

pub fn renormalize(&mut self)
where T: RealField,

Ensure this rotation is an orthonormal rotation matrix. This is useful when repeated computations might cause the matrix from progressively not being orthonormal anymore.

Source

pub fn powf(&self, n: T) -> Self

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

§Example
let rot = Rotation2::new(0.78);
let pow = rot.powf(2.0);
assert_relative_eq!(pow.angle(), 2.0 * 0.78);
Source§

impl<T: SimdRealField> Rotation2<T>

§2D angle extraction

Source

pub fn angle(&self) -> T

The rotation angle.

§Example
let rot = Rotation2::new(1.78);
assert_relative_eq!(rot.angle(), 1.78);
Source

pub fn angle_to(&self, other: &Self) -> T

The rotation angle needed to make self and other coincide.

§Example
let rot1 = Rotation2::new(0.1);
let rot2 = Rotation2::new(1.7);
assert_relative_eq!(rot1.angle_to(&rot2), 1.6);
Source

pub fn scaled_axis(&self) -> SVector<T, 1>

The rotation angle returned as a 1-dimensional vector.

This is generally used in the context of generic programming. Using the .angle() method instead is more common.

Source§

impl<T, const D: usize> Rotation<T, D>

Source

pub const fn from_matrix_unchecked(matrix: SMatrix<T, D, D>) -> Self

Creates a new rotation from the given square matrix.

The matrix orthonormality is not checked.

§Example
let mat = Matrix3::new(0.8660254, -0.5,      0.0,
                       0.5,       0.8660254, 0.0,
                       0.0,       0.0,       1.0);
let rot = Rotation3::from_matrix_unchecked(mat);

assert_eq!(*rot.matrix(), mat);


let mat = Matrix2::new(0.8660254, -0.5,
                       0.5,       0.8660254);
let rot = Rotation2::from_matrix_unchecked(mat);

assert_eq!(*rot.matrix(), mat);
Source§

impl<T: Scalar, const D: usize> Rotation<T, D>

§Conversion to a matrix

Source

pub fn matrix(&self) -> &SMatrix<T, D, D>

A reference to the underlying matrix representation of this rotation.

§Example
let rot = Rotation3::from_axis_angle(&Vector3::z_axis(), f32::consts::FRAC_PI_6);
let expected = Matrix3::new(0.8660254, -0.5,      0.0,
                            0.5,       0.8660254, 0.0,
                            0.0,       0.0,       1.0);
assert_eq!(*rot.matrix(), expected);


let rot = Rotation2::new(f32::consts::FRAC_PI_6);
let expected = Matrix2::new(0.8660254, -0.5,
                            0.5,       0.8660254);
assert_eq!(*rot.matrix(), expected);
Source

pub unsafe fn matrix_mut(&mut self) -> &mut SMatrix<T, D, D>

👎Deprecated: Use .matrix_mut_unchecked() instead.

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

Source

pub fn matrix_mut_unchecked(&mut self) -> &mut SMatrix<T, D, D>

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

This is suffixed by “_unchecked” because this allows the user to replace the matrix by another one that is non-inversible or non-orthonormal. If one of those properties is broken, subsequent method calls may return bogus results.

Source

pub fn into_inner(self) -> SMatrix<T, D, D>

Unwraps the underlying matrix.

§Example
let rot = Rotation3::from_axis_angle(&Vector3::z_axis(), f32::consts::FRAC_PI_6);
let mat = rot.into_inner();
let expected = Matrix3::new(0.8660254, -0.5,      0.0,
                            0.5,       0.8660254, 0.0,
                            0.0,       0.0,       1.0);
assert_eq!(mat, expected);


let rot = Rotation2::new(f32::consts::FRAC_PI_6);
let mat = rot.into_inner();
let expected = Matrix2::new(0.8660254, -0.5,
                            0.5,       0.8660254);
assert_eq!(mat, expected);
Source

pub fn unwrap(self) -> SMatrix<T, D, D>

👎Deprecated: use .into_inner() instead

Unwraps the underlying matrix. Deprecated: Use Rotation::into_inner instead.

Source

pub fn to_homogeneous( &self, ) -> OMatrix<T, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>

Converts this rotation into its equivalent homogeneous transformation matrix.

This is the same as self.into().

§Example
let rot = Rotation3::from_axis_angle(&Vector3::z_axis(), f32::consts::FRAC_PI_6);
let expected = Matrix4::new(0.8660254, -0.5,      0.0, 0.0,
                            0.5,       0.8660254, 0.0, 0.0,
                            0.0,       0.0,       1.0, 0.0,
                            0.0,       0.0,       0.0, 1.0);
assert_eq!(rot.to_homogeneous(), expected);


let rot = Rotation2::new(f32::consts::FRAC_PI_6);
let expected = Matrix3::new(0.8660254, -0.5,      0.0,
                            0.5,       0.8660254, 0.0,
                            0.0,       0.0,       1.0);
assert_eq!(rot.to_homogeneous(), expected);
Source§

impl<T: Scalar, const D: usize> Rotation<T, D>

§Transposition and inversion

Source

pub fn transpose(&self) -> Self

Transposes self.

Same as .inverse() because the inverse of a rotation matrix is its transform.

§Example
let rot = Rotation3::new(Vector3::new(1.0, 2.0, 3.0));
let tr_rot = rot.transpose();
assert_relative_eq!(rot * tr_rot, Rotation3::identity(), epsilon = 1.0e-6);
assert_relative_eq!(tr_rot * rot, Rotation3::identity(), epsilon = 1.0e-6);

let rot = Rotation2::new(1.2);
let tr_rot = rot.transpose();
assert_relative_eq!(rot * tr_rot, Rotation2::identity(), epsilon = 1.0e-6);
assert_relative_eq!(tr_rot * rot, Rotation2::identity(), epsilon = 1.0e-6);
Source

pub fn inverse(&self) -> Self

Inverts self.

Same as .transpose() because the inverse of a rotation matrix is its transform.

§Example
let rot = Rotation3::new(Vector3::new(1.0, 2.0, 3.0));
let inv = rot.inverse();
assert_relative_eq!(rot * inv, Rotation3::identity(), epsilon = 1.0e-6);
assert_relative_eq!(inv * rot, Rotation3::identity(), epsilon = 1.0e-6);

let rot = Rotation2::new(1.2);
let inv = rot.inverse();
assert_relative_eq!(rot * inv, Rotation2::identity(), epsilon = 1.0e-6);
assert_relative_eq!(inv * rot, Rotation2::identity(), epsilon = 1.0e-6);
Source

pub fn transpose_mut(&mut self)

Transposes self in-place.

Same as .inverse_mut() because the inverse of a rotation matrix is its transform.

§Example
let rot = Rotation3::new(Vector3::new(1.0, 2.0, 3.0));
let mut tr_rot = Rotation3::new(Vector3::new(1.0, 2.0, 3.0));
tr_rot.transpose_mut();

assert_relative_eq!(rot * tr_rot, Rotation3::identity(), epsilon = 1.0e-6);
assert_relative_eq!(tr_rot * rot, Rotation3::identity(), epsilon = 1.0e-6);

let rot = Rotation2::new(1.2);
let mut tr_rot = Rotation2::new(1.2);
tr_rot.transpose_mut();

assert_relative_eq!(rot * tr_rot, Rotation2::identity(), epsilon = 1.0e-6);
assert_relative_eq!(tr_rot * rot, Rotation2::identity(), epsilon = 1.0e-6);
Source

pub fn inverse_mut(&mut self)

Inverts self in-place.

Same as .transpose_mut() because the inverse of a rotation matrix is its transform.

§Example
let rot = Rotation3::new(Vector3::new(1.0, 2.0, 3.0));
let mut inv = Rotation3::new(Vector3::new(1.0, 2.0, 3.0));
inv.inverse_mut();

assert_relative_eq!(rot * inv, Rotation3::identity(), epsilon = 1.0e-6);
assert_relative_eq!(inv * rot, Rotation3::identity(), epsilon = 1.0e-6);

let rot = Rotation2::new(1.2);
let mut inv = Rotation2::new(1.2);
inv.inverse_mut();

assert_relative_eq!(rot * inv, Rotation2::identity(), epsilon = 1.0e-6);
assert_relative_eq!(inv * rot, Rotation2::identity(), epsilon = 1.0e-6);
Source§

impl<T: SimdRealField, const D: usize> Rotation<T, D>

§Transformation of a vector or a point

Source

pub fn transform_point(&self, pt: &Point<T, D>) -> Point<T, D>

Rotate the given point.

This is the same as the multiplication self * pt.

§Example
let rot = Rotation3::new(Vector3::y() * f32::consts::FRAC_PI_2);
let transformed_point = rot.transform_point(&Point3::new(1.0, 2.0, 3.0));

assert_relative_eq!(transformed_point, Point3::new(3.0, 2.0, -1.0), epsilon = 1.0e-6);
Source

pub fn transform_vector(&self, v: &SVector<T, D>) -> SVector<T, D>

Rotate the given vector.

This is the same as the multiplication self * v.

§Example
let rot = Rotation3::new(Vector3::y() * f32::consts::FRAC_PI_2);
let transformed_vector = rot.transform_vector(&Vector3::new(1.0, 2.0, 3.0));

assert_relative_eq!(transformed_vector, Vector3::new(3.0, 2.0, -1.0), epsilon = 1.0e-6);
Source

pub fn inverse_transform_point(&self, pt: &Point<T, D>) -> Point<T, D>

Rotate the given point by the inverse of this rotation. This may be cheaper than inverting the rotation and then transforming the given point.

§Example
let rot = Rotation3::new(Vector3::y() * f32::consts::FRAC_PI_2);
let transformed_point = rot.inverse_transform_point(&Point3::new(1.0, 2.0, 3.0));

assert_relative_eq!(transformed_point, Point3::new(-3.0, 2.0, 1.0), epsilon = 1.0e-6);
Source

pub fn inverse_transform_vector(&self, v: &SVector<T, D>) -> SVector<T, D>

Rotate the given vector by the inverse of this rotation. This may be cheaper than inverting the rotation and then transforming the given vector.

§Example
let rot = Rotation3::new(Vector3::y() * f32::consts::FRAC_PI_2);
let transformed_vector = rot.inverse_transform_vector(&Vector3::new(1.0, 2.0, 3.0));

assert_relative_eq!(transformed_vector, Vector3::new(-3.0, 2.0, 1.0), epsilon = 1.0e-6);
Source

pub fn inverse_transform_unit_vector( &self, v: &Unit<SVector<T, D>>, ) -> Unit<SVector<T, D>>

Rotate the given vector by the inverse of this rotation. This may be cheaper than inverting the rotation and then transforming the given vector.

§Example
let rot = Rotation3::new(Vector3::z() * f32::consts::FRAC_PI_2);
let transformed_vector = rot.inverse_transform_unit_vector(&Vector3::x_axis());

assert_relative_eq!(transformed_vector, -Vector3::y_axis(), epsilon = 1.0e-6);
Source§

impl<T, const D: usize> Rotation<T, D>
where T: Scalar + Zero + One,

§Identity

Source

pub fn identity() -> Rotation<T, D>

Creates a new square identity rotation of the given dimension.

§Example
let rot1 = Rotation2::identity();
let rot2 = Rotation2::new(std::f32::consts::FRAC_PI_2);

assert_eq!(rot1 * rot2, rot2);
assert_eq!(rot2 * rot1, rot2);

let rot1 = Rotation3::identity();
let rot2 = Rotation3::from_axis_angle(&Vector3::z_axis(), std::f32::consts::FRAC_PI_2);

assert_eq!(rot1 * rot2, rot2);
assert_eq!(rot2 * rot1, rot2);
Source§

impl<T: Scalar, const D: usize> Rotation<T, D>

Source

pub fn cast<To: Scalar>(self) -> Rotation<To, D>
where Rotation<To, D>: SupersetOf<Self>,

Cast the components of self to another type.

§Example
let rot = Rotation2::<f64>::identity();
let rot2 = rot.cast::<f32>();
assert_eq!(rot2, Rotation2::<f32>::identity());

Trait Implementations§

Source§

impl<T: SimdRealField> From<Unit<Complex<T>>> for Rotation2<T>

Source§

fn from(q: UnitComplex<T>) -> Self

Converts to this type from the input type.
Source§

impl<T1, T2> SubsetOf<Unit<Complex<T2>>> for Rotation2<T1>
where T1: RealField, T2: RealField + SupersetOf<T1>,

Source§

fn to_superset(&self) -> UnitComplex<T2>

The inclusion map: converts self to the equivalent element of its superset.
Source§

fn is_in_subset(q: &UnitComplex<T2>) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Source§

fn from_superset_unchecked(q: &UnitComplex<T2>) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Source§

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

impl<T, const D: usize> AbsDiffEq for Rotation<T, D>
where T: Scalar + AbsDiffEq, T::Epsilon: Clone,

Source§

type Epsilon = <T as AbsDiffEq>::Epsilon

Used for specifying relative comparisons.
Source§

fn default_epsilon() -> Self::Epsilon

The default tolerance to use when testing values that are close together. Read more
Source§

fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool

A test for equality that uses the absolute difference to compute the approximate equality of two numbers.
Source§

fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool

The inverse of AbsDiffEq::abs_diff_eq.
Source§

impl<T: SimdRealField, const D: usize> AbstractRotation<T, D> for Rotation<T, D>

Source§

fn identity() -> Self

The rotation identity.
Source§

fn inverse(&self) -> Self

The rotation inverse.
Source§

fn inverse_mut(&mut self)

Change self to its inverse.
Source§

fn transform_vector(&self, v: &SVector<T, D>) -> SVector<T, D>

Apply the rotation to the given vector.
Source§

fn transform_point(&self, p: &Point<T, D>) -> Point<T, D>

Apply the rotation to the given point.
Source§

fn inverse_transform_vector(&self, v: &SVector<T, D>) -> SVector<T, D>

Apply the inverse rotation to the given vector.
Source§

fn inverse_transform_unit_vector( &self, v: &Unit<SVector<T, D>>, ) -> Unit<SVector<T, D>>

Apply the inverse rotation to the given unit vector.
Source§

fn inverse_transform_point(&self, p: &Point<T, D>) -> Point<T, D>

Apply the inverse rotation to the given point.
Source§

impl<T: Clone, const D: usize> Clone for Rotation<T, D>

Source§

fn clone(&self) -> Rotation<T, D>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, const D: usize> Debug for Rotation<T, D>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T, const D: usize> Default for Rotation<T, D>
where T: Scalar + Zero + One,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a, T: Scalar, const D: usize> Deserialize<'a> for Rotation<T, D>
where Owned<T, Const<D>, Const<D>>: Deserialize<'a>,

Source§

fn deserialize<Des>(deserializer: Des) -> Result<Self, Des::Error>
where Des: Deserializer<'a>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T, const D: usize> Display for Rotation<T, D>
where T: RealField + Display,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'b, T: SimdRealField, const D: usize> Div<&'b Isometry<T, Rotation<T, D>, D>> for Rotation<T, D>

Source§

type Output = Isometry<T, Rotation<T, D>, D>

The resulting type after applying the / operator.
Source§

fn div(self, right: &'b Isometry<T, Rotation<T, D>, D>) -> Self::Output

Performs the / operation. Read more
Source§

impl<'b, T, const D: usize> Div<&'b Rotation<T, D>> for Rotation<T, D>
where T: Scalar + Zero + One + ClosedAdd + ClosedMul,

Source§

type Output = Rotation<T, D>

The resulting type after applying the / operator.
Source§

fn div(self, right: &'b Rotation<T, D>) -> Self::Output

Performs the / operation. Read more
Source§

impl<'b, T: SimdRealField, const D: usize> Div<&'b Similarity<T, Rotation<T, D>, D>> for Rotation<T, D>

Source§

type Output = Similarity<T, Rotation<T, D>, D>

The resulting type after applying the / operator.
Source§

fn div(self, right: &'b Similarity<T, Rotation<T, D>, D>) -> Self::Output

Performs the / operation. Read more
Source§

impl<'b, T, C, const D: usize> Div<&'b Transform<T, C, D>> for Rotation<T, D>

Source§

type Output = Transform<T, <C as TCategoryMul<TAffine>>::Representative, D>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &'b Transform<T, C, D>) -> Self::Output

Performs the / operation. Read more
Source§

impl<'b, T: SimdRealField> Div<&'b Unit<Complex<T>>> for Rotation<T, 2>

Source§

type Output = Unit<Complex<T>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &'b UnitComplex<T>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: SimdRealField, const D: usize> Div<Isometry<T, Rotation<T, D>, D>> for Rotation<T, D>

Source§

type Output = Isometry<T, Rotation<T, D>, D>

The resulting type after applying the / operator.
Source§

fn div(self, right: Isometry<T, Rotation<T, D>, D>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: SimdRealField, const D: usize> Div<Similarity<T, Rotation<T, D>, D>> for Rotation<T, D>

Source§

type Output = Similarity<T, Rotation<T, D>, D>

The resulting type after applying the / operator.
Source§

fn div(self, right: Similarity<T, Rotation<T, D>, D>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T, C, const D: usize> Div<Transform<T, C, D>> for Rotation<T, D>

Source§

type Output = Transform<T, <C as TCategoryMul<TAffine>>::Representative, D>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Transform<T, C, D>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: SimdRealField> Div<Unit<Complex<T>>> for Rotation<T, 2>

Source§

type Output = Unit<Complex<T>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitComplex<T>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T, const D: usize> Div for Rotation<T, D>
where T: Scalar + Zero + One + ClosedAdd + ClosedMul,

Source§

type Output = Rotation<T, D>

The resulting type after applying the / operator.
Source§

fn div(self, right: Rotation<T, D>) -> Self::Output

Performs the / operation. Read more
Source§

impl<'b, T, const D: usize> DivAssign<&'b Rotation<T, D>> for Rotation<T, D>
where T: Scalar + Zero + One + ClosedAdd + ClosedMul,

Source§

fn div_assign(&mut self, right: &'b Rotation<T, D>)

Performs the /= operation. Read more
Source§

impl<'b, T: SimdRealField> DivAssign<&'b Unit<Complex<T>>> for Rotation<T, 2>

Source§

fn div_assign(&mut self, rhs: &'b UnitComplex<T>)

Performs the /= operation. Read more
Source§

impl<T: SimdRealField> DivAssign<Unit<Complex<T>>> for Rotation<T, 2>

Source§

fn div_assign(&mut self, rhs: UnitComplex<T>)

Performs the /= operation. Read more
Source§

impl<T, const D: usize> DivAssign for Rotation<T, D>
where T: Scalar + Zero + One + ClosedAdd + ClosedMul,

Source§

fn div_assign(&mut self, right: Rotation<T, D>)

Performs the /= operation. Read more
Source§

impl<T, const D: usize> From<[Rotation<<T as SimdValue>::Element, D>; 16]> for Rotation<T, D>

Source§

fn from(arr: [Rotation<T::Element, D>; 16]) -> Self

Converts to this type from the input type.
Source§

impl<T, const D: usize> From<[Rotation<<T as SimdValue>::Element, D>; 2]> for Rotation<T, D>

Source§

fn from(arr: [Rotation<T::Element, D>; 2]) -> Self

Converts to this type from the input type.
Source§

impl<T, const D: usize> From<[Rotation<<T as SimdValue>::Element, D>; 4]> for Rotation<T, D>

Source§

fn from(arr: [Rotation<T::Element, D>; 4]) -> Self

Converts to this type from the input type.
Source§

impl<T, const D: usize> From<[Rotation<<T as SimdValue>::Element, D>; 8]> for Rotation<T, D>

Source§

fn from(arr: [Rotation<T::Element, D>; 8]) -> Self

Converts to this type from the input type.
Source§

impl<T: Scalar + Hash, const D: usize> Hash for Rotation<T, D>
where <DefaultAllocator as Allocator<T, Const<D>, Const<D>>>::Buffer: Hash,

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T: Scalar, const D: usize> Index<(usize, usize)> for Rotation<T, D>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, row_col: (usize, usize)) -> &T

Performs the indexing (container[index]) operation. Read more
Source§

impl<'b, T: SimdRealField, const D: usize> Mul<&'b Isometry<T, Rotation<T, D>, D>> for Rotation<T, D>

Source§

type Output = Isometry<T, Rotation<T, D>, D>

The resulting type after applying the * operator.
Source§

fn mul(self, right: &'b Isometry<T, Rotation<T, D>, D>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'b, T, R2, C2, SB, const D1: usize> Mul<&'b Matrix<T, R2, C2, SB>> for Rotation<T, D1>
where T: Scalar + Zero + One + ClosedAdd + ClosedMul, R2: Dim, C2: Dim, SB: Storage<T, R2, C2>, DefaultAllocator: Allocator<T, Const<D1>, C2>, ShapeConstraint: AreMultipliable<Const<D1>, Const<D1>, R2, C2>,

Source§

type Output = Matrix<T, Const<D1>, C2, <DefaultAllocator as Allocator<T, Const<D1>, C2>>::Buffer>

The resulting type after applying the * operator.
Source§

fn mul(self, right: &'b Matrix<T, R2, C2, SB>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'b, T, const D: usize> Mul<&'b OPoint<T, Const<D>>> for Rotation<T, D>

Source§

type Output = OPoint<T, Const<D>>

The resulting type after applying the * operator.
Source§

fn mul(self, right: &'b Point<T, D>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'b, T, const D: usize> Mul<&'b Rotation<T, D>> for Rotation<T, D>
where T: Scalar + Zero + One + ClosedAdd + ClosedMul,

Source§

type Output = Rotation<T, D>

The resulting type after applying the * operator.
Source§

fn mul(self, right: &'b Rotation<T, D>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'b, T: SimdRealField, const D: usize> Mul<&'b Similarity<T, Rotation<T, D>, D>> for Rotation<T, D>

Source§

type Output = Similarity<T, Rotation<T, D>, D>

The resulting type after applying the * operator.
Source§

fn mul(self, right: &'b Similarity<T, Rotation<T, D>, D>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'b, T, C, const D: usize> Mul<&'b Transform<T, C, D>> for Rotation<T, D>

Source§

type Output = Transform<T, <C as TCategoryMul<TAffine>>::Representative, D>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &'b Transform<T, C, D>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'b, T: SimdRealField, const D: usize> Mul<&'b Translation<T, D>> for Rotation<T, D>

Source§

type Output = Isometry<T, Rotation<T, D>, D>

The resulting type after applying the * operator.
Source§

fn mul(self, right: &'b Translation<T, D>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'b, T: SimdRealField> Mul<&'b Unit<Complex<T>>> for Rotation<T, 2>

Source§

type Output = Unit<Complex<T>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &'b UnitComplex<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'b, T, S, const D: usize> Mul<&'b Unit<Matrix<T, Const<D>, Const<1>, S>>> for Rotation<T, D>

Source§

type Output = Unit<Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>>

The resulting type after applying the * operator.
Source§

fn mul(self, right: &'b Unit<Vector<T, Const<D>, S>>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: SimdRealField, const D: usize> Mul<Isometry<T, Rotation<T, D>, D>> for Rotation<T, D>

Source§

type Output = Isometry<T, Rotation<T, D>, D>

The resulting type after applying the * operator.
Source§

fn mul(self, right: Isometry<T, Rotation<T, D>, D>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, R2, C2, SB, const D1: usize> Mul<Matrix<T, R2, C2, SB>> for Rotation<T, D1>
where T: Scalar + Zero + One + ClosedAdd + ClosedMul, R2: Dim, C2: Dim, SB: Storage<T, R2, C2>, DefaultAllocator: Allocator<T, Const<D1>, C2>, ShapeConstraint: AreMultipliable<Const<D1>, Const<D1>, R2, C2>,

Source§

type Output = Matrix<T, Const<D1>, C2, <DefaultAllocator as Allocator<T, Const<D1>, C2>>::Buffer>

The resulting type after applying the * operator.
Source§

fn mul(self, right: Matrix<T, R2, C2, SB>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, const D: usize> Mul<OPoint<T, Const<D>>> for Rotation<T, D>

Source§

type Output = OPoint<T, Const<D>>

The resulting type after applying the * operator.
Source§

fn mul(self, right: Point<T, D>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: SimdRealField, const D: usize> Mul<Similarity<T, Rotation<T, D>, D>> for Rotation<T, D>

Source§

type Output = Similarity<T, Rotation<T, D>, D>

The resulting type after applying the * operator.
Source§

fn mul(self, right: Similarity<T, Rotation<T, D>, D>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, C, const D: usize> Mul<Transform<T, C, D>> for Rotation<T, D>

Source§

type Output = Transform<T, <C as TCategoryMul<TAffine>>::Representative, D>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Transform<T, C, D>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: SimdRealField, const D: usize> Mul<Translation<T, D>> for Rotation<T, D>

Source§

type Output = Isometry<T, Rotation<T, D>, D>

The resulting type after applying the * operator.
Source§

fn mul(self, right: Translation<T, D>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: SimdRealField> Mul<Unit<Complex<T>>> for Rotation<T, 2>

Source§

type Output = Unit<Complex<T>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnitComplex<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, S, const D: usize> Mul<Unit<Matrix<T, Const<D>, Const<1>, S>>> for Rotation<T, D>

Source§

type Output = Unit<Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>>

The resulting type after applying the * operator.
Source§

fn mul(self, right: Unit<Vector<T, Const<D>, S>>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, const D: usize> Mul for Rotation<T, D>
where T: Scalar + Zero + One + ClosedAdd + ClosedMul,

Source§

type Output = Rotation<T, D>

The resulting type after applying the * operator.
Source§

fn mul(self, right: Rotation<T, D>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'b, T, const D: usize> MulAssign<&'b Rotation<T, D>> for Rotation<T, D>
where T: Scalar + Zero + One + ClosedAdd + ClosedMul,

Source§

fn mul_assign(&mut self, right: &'b Rotation<T, D>)

Performs the *= operation. Read more
Source§

impl<'b, T: SimdRealField> MulAssign<&'b Unit<Complex<T>>> for Rotation<T, 2>

Source§

fn mul_assign(&mut self, rhs: &'b UnitComplex<T>)

Performs the *= operation. Read more
Source§

impl<T: SimdRealField> MulAssign<Unit<Complex<T>>> for Rotation<T, 2>

Source§

fn mul_assign(&mut self, rhs: UnitComplex<T>)

Performs the *= operation. Read more
Source§

impl<T, const D: usize> MulAssign for Rotation<T, D>
where T: Scalar + Zero + One + ClosedAdd + ClosedMul,

Source§

fn mul_assign(&mut self, right: Rotation<T, D>)

Performs the *= operation. Read more
Source§

impl<T, const D: usize> One for Rotation<T, D>
where T: Scalar + Zero + One + ClosedAdd + ClosedMul,

Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

fn is_one(&self) -> bool
where Self: PartialEq,

Returns true if self is equal to the multiplicative identity. Read more
Source§

impl<T: Scalar + PartialEq, const D: usize> PartialEq for Rotation<T, D>

Source§

fn eq(&self, right: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T, const D: usize> RelativeEq for Rotation<T, D>
where T: Scalar + RelativeEq, T::Epsilon: Clone,

Source§

fn default_max_relative() -> Self::Epsilon

The default relative tolerance for testing values that are far-apart. Read more
Source§

fn relative_eq( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool

A test for equality that uses a relative comparison if the values are far apart.
Source§

fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool

The inverse of RelativeEq::relative_eq.
Source§

impl<T: Scalar, const D: usize> Serialize for Rotation<T, D>
where Owned<T, Const<D>, Const<D>>: Serialize,

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T, const D: usize> SimdValue for Rotation<T, D>
where T: Scalar + SimdValue, T::Element: Scalar,

Source§

type Element = Rotation<<T as SimdValue>::Element, D>

The type of the elements of each lane of this SIMD value.
Source§

type SimdBool = <T as SimdValue>::SimdBool

Type of the result of comparing two SIMD values like self.
Source§

fn lanes() -> usize

The number of lanes of this SIMD value.
Source§

fn splat(val: Self::Element) -> Self

Initializes an SIMD value with each lanes set to val.
Source§

fn extract(&self, i: usize) -> Self::Element

Extracts the i-th lane of self. Read more
Source§

unsafe fn extract_unchecked(&self, i: usize) -> Self::Element

Extracts the i-th lane of self without bound-checking.
Source§

fn replace(&mut self, i: usize, val: Self::Element)

Replaces the i-th lane of self by val. Read more
Source§

unsafe fn replace_unchecked(&mut self, i: usize, val: Self::Element)

Replaces the i-th lane of self by val without bound-checking.
Source§

fn select(self, cond: Self::SimdBool, other: Self) -> Self

Merges self and other depending on the lanes of cond. Read more
Source§

fn map_lanes(self, f: impl Fn(Self::Element) -> Self::Element) -> Self
where Self: Clone,

Applies a function to each lane of self. Read more
Source§

fn zip_map_lanes( self, b: Self, f: impl Fn(Self::Element, Self::Element) -> Self::Element, ) -> Self
where Self: Clone,

Applies a function to each lane of self paired with the corresponding lane of b. Read more
Source§

impl<T1, T2, R, const D: usize> SubsetOf<Isometry<T2, R, D>> for Rotation<T1, D>
where T1: RealField, T2: RealField + SupersetOf<T1>, R: AbstractRotation<T2, D> + SupersetOf<Self>,

Source§

fn to_superset(&self) -> Isometry<T2, R, D>

The inclusion map: converts self to the equivalent element of its superset.
Source§

fn is_in_subset(iso: &Isometry<T2, R, D>) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Source§

fn from_superset_unchecked(iso: &Isometry<T2, R, D>) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Source§

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

impl<T1, T2, const D: usize> SubsetOf<Matrix<T2, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<T2, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer>> for Rotation<T1, D>

Source§

fn to_superset( &self, ) -> OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>

The inclusion map: converts self to the equivalent element of its superset.
Source§

fn is_in_subset( m: &OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>, ) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Source§

fn from_superset_unchecked( m: &OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>, ) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Source§

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

impl<T1, T2, const D: usize> SubsetOf<Rotation<T2, D>> for Rotation<T1, D>
where T1: RealField, T2: RealField + SupersetOf<T1>,

Source§

fn to_superset(&self) -> Rotation<T2, D>

The inclusion map: converts self to the equivalent element of its superset.
Source§

fn is_in_subset(rot: &Rotation<T2, D>) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Source§

fn from_superset_unchecked(rot: &Rotation<T2, D>) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Source§

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

impl<T1, T2, R, const D: usize> SubsetOf<Similarity<T2, R, D>> for Rotation<T1, D>
where T1: RealField, T2: RealField + SupersetOf<T1>, R: AbstractRotation<T2, D> + SupersetOf<Self>,

Source§

fn to_superset(&self) -> Similarity<T2, R, D>

The inclusion map: converts self to the equivalent element of its superset.
Source§

fn is_in_subset(sim: &Similarity<T2, R, D>) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Source§

fn from_superset_unchecked(sim: &Similarity<T2, R, D>) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Source§

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

impl<T1, T2, C, const D: usize> SubsetOf<Transform<T2, C, D>> for Rotation<T1, D>

Source§

fn to_superset(&self) -> Transform<T2, C, D>

The inclusion map: converts self to the equivalent element of its superset.
Source§

fn is_in_subset(t: &Transform<T2, C, D>) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Source§

fn from_superset_unchecked(t: &Transform<T2, C, D>) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Source§

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

impl<T, const D: usize> UlpsEq for Rotation<T, D>
where T: Scalar + UlpsEq, T::Epsilon: Clone,

Source§

fn default_max_ulps() -> u32

The default ULPs to tolerate when testing values that are far-apart. Read more
Source§

fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool

A test for equality that uses units in the last place (ULP) if the values are far apart.
Source§

fn ulps_ne(&self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32) -> bool

The inverse of UlpsEq::ulps_eq.
Source§

impl<T: Copy, const D: usize> Copy for Rotation<T, D>

Source§

impl<T: Scalar + Eq, const D: usize> Eq for Rotation<T, D>