#[repr(C)]
pub struct Isometry<T, R, const D: usize> { pub rotation: R, pub translation: Translation<T, D>, }
Expand description

A direct isometry, i.e., a rotation followed by a translation (aka. a rigid-body motion).

This is also known as an element of a Special Euclidean (SE) group. The Isometry type can either represent a 2D or 3D isometry. A 2D isometry is composed of:

Note that instead of using the Isometry type in your code directly, you should use one of its aliases: Isometry2, Isometry3, IsometryMatrix2, IsometryMatrix3. Though keep in mind that all the documentation of all the methods of these aliases will also appears on this page.

Construction

Transformation and composition

Note that transforming vectors and points can be done by multiplication, e.g., isometry * point. Composing an isometry with another transformation can also be done by multiplication or division.

Conversion to a matrix

Fields

rotation: R

The pure rotational part of this isometry.

translation: Translation<T, D>

The pure translational part of this isometry.

Implementations

Creates a new isometry from its rotational and translational parts.

Example
let tra = Translation3::new(0.0, 0.0, 3.0);
let rot = UnitQuaternion::from_scaled_axis(Vector3::y() * f32::consts::PI);
let iso = Isometry3::from_parts(tra, rot);

assert_relative_eq!(iso * Point3::new(1.0, 2.0, 3.0), Point3::new(-1.0, 2.0, 0.0), epsilon = 1.0e-6);

Inverts self.

Example
let iso = Isometry2::new(Vector2::new(1.0, 2.0), f32::consts::FRAC_PI_2);
let inv = iso.inverse();
let pt = Point2::new(1.0, 2.0);

assert_eq!(inv * (iso * pt), pt);

Inverts self in-place.

Example
let mut iso = Isometry2::new(Vector2::new(1.0, 2.0), f32::consts::FRAC_PI_2);
let pt = Point2::new(1.0, 2.0);
let transformed_pt = iso * pt;
iso.inverse_mut();

assert_eq!(iso * transformed_pt, pt);

Computes self.inverse() * rhs in a more efficient way.

Example
let mut iso1 = Isometry2::new(Vector2::new(1.0, 2.0), f32::consts::FRAC_PI_2);
let mut iso2 = Isometry2::new(Vector2::new(10.0, 20.0), f32::consts::FRAC_PI_4);

assert_eq!(iso1.inverse() * iso2, iso1.inv_mul(&iso2));

Appends to self the given translation in-place.

Example
let mut iso = Isometry2::new(Vector2::new(1.0, 2.0), f32::consts::FRAC_PI_2);
let tra = Translation2::new(3.0, 4.0);
// Same as `iso = tra * iso`.
iso.append_translation_mut(&tra);

assert_eq!(iso.translation, Translation2::new(4.0, 6.0));

Appends to self the given rotation in-place.

Example
let mut iso = Isometry2::new(Vector2::new(1.0, 2.0), f32::consts::PI / 6.0);
let rot = UnitComplex::new(f32::consts::PI / 2.0);
// Same as `iso = rot * iso`.
iso.append_rotation_mut(&rot);

assert_relative_eq!(iso, Isometry2::new(Vector2::new(-2.0, 1.0), f32::consts::PI * 2.0 / 3.0), epsilon = 1.0e-6);

Appends in-place to self a rotation centered at the point p, i.e., the rotation that lets p invariant.

Example
let mut iso = Isometry2::new(Vector2::new(1.0, 2.0), f32::consts::FRAC_PI_2);
let rot = UnitComplex::new(f32::consts::FRAC_PI_2);
let pt = Point2::new(1.0, 0.0);
iso.append_rotation_wrt_point_mut(&rot, &pt);

assert_relative_eq!(iso * pt, Point2::new(-2.0, 0.0), epsilon = 1.0e-6);

Appends in-place to self a rotation centered at the point with coordinates self.translation.

Example
let mut iso = Isometry2::new(Vector2::new(1.0, 2.0), f32::consts::FRAC_PI_2);
let rot = UnitComplex::new(f32::consts::FRAC_PI_2);
iso.append_rotation_wrt_center_mut(&rot);

// The translation part should not have changed.
assert_eq!(iso.translation.vector, Vector2::new(1.0, 2.0));
assert_eq!(iso.rotation, UnitComplex::new(f32::consts::PI));

Transform the given point by this isometry.

This is the same as the multiplication self * pt.

Example
let tra = Translation3::new(0.0, 0.0, 3.0);
let rot = UnitQuaternion::from_scaled_axis(Vector3::y() * f32::consts::FRAC_PI_2);
let iso = Isometry3::from_parts(tra, rot);

let transformed_point = iso.transform_point(&Point3::new(1.0, 2.0, 3.0));
assert_relative_eq!(transformed_point, Point3::new(3.0, 2.0, 2.0), epsilon = 1.0e-6);

Transform the given vector by this isometry, ignoring the translation component of the isometry.

This is the same as the multiplication self * v.

Example
let tra = Translation3::new(0.0, 0.0, 3.0);
let rot = UnitQuaternion::from_scaled_axis(Vector3::y() * f32::consts::FRAC_PI_2);
let iso = Isometry3::from_parts(tra, rot);

let transformed_point = iso.transform_vector(&Vector3::new(1.0, 2.0, 3.0));
assert_relative_eq!(transformed_point, Vector3::new(3.0, 2.0, -1.0), epsilon = 1.0e-6);

Transform the given point by the inverse of this isometry. This may be less expensive than computing the entire isometry inverse and then transforming the point.

Example
let tra = Translation3::new(0.0, 0.0, 3.0);
let rot = UnitQuaternion::from_scaled_axis(Vector3::y() * f32::consts::FRAC_PI_2);
let iso = Isometry3::from_parts(tra, rot);

let transformed_point = iso.inverse_transform_point(&Point3::new(1.0, 2.0, 3.0));
assert_relative_eq!(transformed_point, Point3::new(0.0, 2.0, 1.0), epsilon = 1.0e-6);

Transform the given vector by the inverse of this isometry, ignoring the translation component of the isometry. This may be less expensive than computing the entire isometry inverse and then transforming the point.

Example
let tra = Translation3::new(0.0, 0.0, 3.0);
let rot = UnitQuaternion::from_scaled_axis(Vector3::y() * f32::consts::FRAC_PI_2);
let iso = Isometry3::from_parts(tra, rot);

let transformed_point = iso.inverse_transform_vector(&Vector3::new(1.0, 2.0, 3.0));
assert_relative_eq!(transformed_point, Vector3::new(-3.0, 2.0, 1.0), epsilon = 1.0e-6);

Transform the given unit vector by the inverse of this isometry, ignoring the translation component of the isometry. This may be less expensive than computing the entire isometry inverse and then transforming the point.

Example
let tra = Translation3::new(0.0, 0.0, 3.0);
let rot = UnitQuaternion::from_scaled_axis(Vector3::z() * f32::consts::FRAC_PI_2);
let iso = Isometry3::from_parts(tra, rot);

let transformed_point = iso.inverse_transform_unit_vector(&Vector3::x_axis());
assert_relative_eq!(transformed_point, -Vector3::y_axis(), epsilon = 1.0e-6);

Converts this isometry into its equivalent homogeneous transformation matrix.

This is the same as self.to_matrix().

Example
let iso = Isometry2::new(Vector2::new(10.0, 20.0), f32::consts::FRAC_PI_6);
let expected = Matrix3::new(0.8660254, -0.5,      10.0,
                            0.5,       0.8660254, 20.0,
                            0.0,       0.0,       1.0);

assert_relative_eq!(iso.to_homogeneous(), expected, epsilon = 1.0e-6);

Converts this isometry into its equivalent homogeneous transformation matrix.

This is the same as self.to_homogeneous().

Example
let iso = Isometry2::new(Vector2::new(10.0, 20.0), f32::consts::FRAC_PI_6);
let expected = Matrix3::new(0.8660254, -0.5,      10.0,
                            0.5,       0.8660254, 20.0,
                            0.0,       0.0,       1.0);

assert_relative_eq!(iso.to_matrix(), expected, epsilon = 1.0e-6);

Creates a new identity isometry.

Example

let iso = Isometry2::identity();
let pt = Point2::new(1.0, 2.0);
assert_eq!(iso * pt, pt);

let iso = Isometry3::identity();
let pt = Point3::new(1.0, 2.0, 3.0);
assert_eq!(iso * pt, pt);

The isometry that applies the rotation r with its axis passing through the point p. This effectively lets p invariant.

Example
let rot = UnitComplex::new(f32::consts::PI);
let pt = Point2::new(1.0, 0.0);
let iso = Isometry2::rotation_wrt_point(rot, pt);

assert_eq!(iso * pt, pt); // The rotation center is not affected.
assert_relative_eq!(iso * Point2::new(1.0, 2.0), Point2::new(1.0, -2.0), epsilon = 1.0e-6);

Creates a new 2D isometry from a translation and a rotation angle.

Its rotational part is represented as a 2x2 rotation matrix.

Example
let iso = Isometry2::new(Vector2::new(1.0, 2.0), f32::consts::FRAC_PI_2);

assert_eq!(iso * Point2::new(3.0, 4.0), Point2::new(-3.0, 5.0));

Creates a new isometry from the given translation coordinates.

Creates a new isometry from the given rotation angle.

Cast the components of self to another type.

Example
let iso = IsometryMatrix2::<f64>::identity();
let iso2 = iso.cast::<f32>();
assert_eq!(iso2, IsometryMatrix2::<f32>::identity());

Creates a new 2D isometry from a translation and a rotation angle.

Its rotational part is represented as an unit complex number.

Example
let iso = IsometryMatrix2::new(Vector2::new(1.0, 2.0), f32::consts::FRAC_PI_2);

assert_eq!(iso * Point2::new(3.0, 4.0), Point2::new(-3.0, 5.0));

Creates a new isometry from the given translation coordinates.

Creates a new isometry from the given rotation angle.

Cast the components of self to another type.

Example
let iso = Isometry2::<f64>::identity();
let iso2 = iso.cast::<f32>();
assert_eq!(iso2, Isometry2::<f32>::identity());

Creates a new isometry from a translation and a rotation axis-angle.

Example
let axisangle = Vector3::y() * f32::consts::FRAC_PI_2;
let translation = Vector3::new(1.0, 2.0, 3.0);
// Point and vector being transformed in the tests.
let pt = Point3::new(4.0, 5.0, 6.0);
let vec = Vector3::new(4.0, 5.0, 6.0);

// Isometry with its rotation part represented as a UnitQuaternion
let iso = Isometry3::new(translation, axisangle);
assert_relative_eq!(iso * pt, Point3::new(7.0, 7.0, -1.0), epsilon = 1.0e-6);
assert_relative_eq!(iso * vec, Vector3::new(6.0, 5.0, -4.0), epsilon = 1.0e-6);

// Isometry with its rotation part represented as a Rotation3 (a 3x3 rotation matrix).
let iso = IsometryMatrix3::new(translation, axisangle);
assert_relative_eq!(iso * pt, Point3::new(7.0, 7.0, -1.0), epsilon = 1.0e-6);
assert_relative_eq!(iso * vec, Vector3::new(6.0, 5.0, -4.0), epsilon = 1.0e-6);

Creates a new isometry from the given translation coordinates.

Creates a new isometry from the given rotation angle.

Cast the components of self to another type.

Example
let iso = Isometry3::<f64>::identity();
let iso2 = iso.cast::<f32>();
assert_eq!(iso2, Isometry3::<f32>::identity());

Creates a new isometry from a translation and a rotation axis-angle.

Example
let axisangle = Vector3::y() * f32::consts::FRAC_PI_2;
let translation = Vector3::new(1.0, 2.0, 3.0);
// Point and vector being transformed in the tests.
let pt = Point3::new(4.0, 5.0, 6.0);
let vec = Vector3::new(4.0, 5.0, 6.0);

// Isometry with its rotation part represented as a UnitQuaternion
let iso = Isometry3::new(translation, axisangle);
assert_relative_eq!(iso * pt, Point3::new(7.0, 7.0, -1.0), epsilon = 1.0e-6);
assert_relative_eq!(iso * vec, Vector3::new(6.0, 5.0, -4.0), epsilon = 1.0e-6);

// Isometry with its rotation part represented as a Rotation3 (a 3x3 rotation matrix).
let iso = IsometryMatrix3::new(translation, axisangle);
assert_relative_eq!(iso * pt, Point3::new(7.0, 7.0, -1.0), epsilon = 1.0e-6);
assert_relative_eq!(iso * vec, Vector3::new(6.0, 5.0, -4.0), epsilon = 1.0e-6);

Creates a new isometry from the given translation coordinates.

Creates a new isometry from the given rotation angle.

Cast the components of self to another type.

Example
let iso = IsometryMatrix3::<f64>::identity();
let iso2 = iso.cast::<f32>();
assert_eq!(iso2, IsometryMatrix3::<f32>::identity());

Creates an isometry that corresponds to the local frame of an observer standing at the point eye and looking toward target.

It maps the z axis to the view direction target - eyeand the origin to the eye.

Arguments
  • eye - The observer position.
  • target - The target position.
  • up - Vertical direction. The only requirement of this parameter is to not be collinear to eye - at. Non-collinearity is not checked.
Example
let eye = Point3::new(1.0, 2.0, 3.0);
let target = Point3::new(2.0, 2.0, 3.0);
let up = Vector3::y();

// Isometry with its rotation part represented as a UnitQuaternion
let iso = Isometry3::face_towards(&eye, &target, &up);
assert_eq!(iso * Point3::origin(), eye);
assert_relative_eq!(iso * Vector3::z(), Vector3::x());

// Isometry with its rotation part represented as Rotation3 (a 3x3 rotation matrix).
let iso = IsometryMatrix3::face_towards(&eye, &target, &up);
assert_eq!(iso * Point3::origin(), eye);
assert_relative_eq!(iso * Vector3::z(), Vector3::x());
👎Deprecated: renamed to face_towards

Deprecated: Use Isometry::face_towards instead.

Builds a right-handed look-at view matrix.

It maps the view direction target - eye to the negative z axis to and the eye to the origin. This conforms to the common notion of right handed camera look-at view matrix from the computer graphics community, i.e. the camera is assumed to look toward its local -z axis.

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.
Example
let eye = Point3::new(1.0, 2.0, 3.0);
let target = Point3::new(2.0, 2.0, 3.0);
let up = Vector3::y();

// Isometry with its rotation part represented as a UnitQuaternion
let iso = Isometry3::look_at_rh(&eye, &target, &up);
assert_eq!(iso * eye, Point3::origin());
assert_relative_eq!(iso * Vector3::x(), -Vector3::z());

// Isometry with its rotation part represented as Rotation3 (a 3x3 rotation matrix).
let iso = IsometryMatrix3::look_at_rh(&eye, &target, &up);
assert_eq!(iso * eye, Point3::origin());
assert_relative_eq!(iso * Vector3::x(), -Vector3::z());

Builds a left-handed look-at view matrix.

It maps the view direction target - eye to the positive z axis and the eye to the origin. This conforms to the common notion of right handed camera look-at view matrix from the computer graphics community, i.e. the camera is assumed to look toward its local z axis.

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.
Example
let eye = Point3::new(1.0, 2.0, 3.0);
let target = Point3::new(2.0, 2.0, 3.0);
let up = Vector3::y();

// Isometry with its rotation part represented as a UnitQuaternion
let iso = Isometry3::look_at_lh(&eye, &target, &up);
assert_eq!(iso * eye, Point3::origin());
assert_relative_eq!(iso * Vector3::x(), Vector3::z());

// Isometry with its rotation part represented as Rotation3 (a 3x3 rotation matrix).
let iso = IsometryMatrix3::look_at_lh(&eye, &target, &up);
assert_eq!(iso * eye, Point3::origin());
assert_relative_eq!(iso * Vector3::x(), Vector3::z());

Creates an isometry that corresponds to the local frame of an observer standing at the point eye and looking toward target.

It maps the z axis to the view direction target - eyeand the origin to the eye.

Arguments
  • eye - The observer position.
  • target - The target position.
  • up - Vertical direction. The only requirement of this parameter is to not be collinear to eye - at. Non-collinearity is not checked.
Example
let eye = Point3::new(1.0, 2.0, 3.0);
let target = Point3::new(2.0, 2.0, 3.0);
let up = Vector3::y();

// Isometry with its rotation part represented as a UnitQuaternion
let iso = Isometry3::face_towards(&eye, &target, &up);
assert_eq!(iso * Point3::origin(), eye);
assert_relative_eq!(iso * Vector3::z(), Vector3::x());

// Isometry with its rotation part represented as Rotation3 (a 3x3 rotation matrix).
let iso = IsometryMatrix3::face_towards(&eye, &target, &up);
assert_eq!(iso * Point3::origin(), eye);
assert_relative_eq!(iso * Vector3::z(), Vector3::x());
👎Deprecated: renamed to face_towards

Deprecated: Use Isometry::face_towards instead.

Builds a right-handed look-at view matrix.

It maps the view direction target - eye to the negative z axis to and the eye to the origin. This conforms to the common notion of right handed camera look-at view matrix from the computer graphics community, i.e. the camera is assumed to look toward its local -z axis.

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.
Example
let eye = Point3::new(1.0, 2.0, 3.0);
let target = Point3::new(2.0, 2.0, 3.0);
let up = Vector3::y();

// Isometry with its rotation part represented as a UnitQuaternion
let iso = Isometry3::look_at_rh(&eye, &target, &up);
assert_eq!(iso * eye, Point3::origin());
assert_relative_eq!(iso * Vector3::x(), -Vector3::z());

// Isometry with its rotation part represented as Rotation3 (a 3x3 rotation matrix).
let iso = IsometryMatrix3::look_at_rh(&eye, &target, &up);
assert_eq!(iso * eye, Point3::origin());
assert_relative_eq!(iso * Vector3::x(), -Vector3::z());

Builds a left-handed look-at view matrix.

It maps the view direction target - eye to the positive z axis and the eye to the origin. This conforms to the common notion of right handed camera look-at view matrix from the computer graphics community, i.e. the camera is assumed to look toward its local z axis.

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.
Example
let eye = Point3::new(1.0, 2.0, 3.0);
let target = Point3::new(2.0, 2.0, 3.0);
let up = Vector3::y();

// Isometry with its rotation part represented as a UnitQuaternion
let iso = Isometry3::look_at_lh(&eye, &target, &up);
assert_eq!(iso * eye, Point3::origin());
assert_relative_eq!(iso * Vector3::x(), Vector3::z());

// Isometry with its rotation part represented as Rotation3 (a 3x3 rotation matrix).
let iso = IsometryMatrix3::look_at_lh(&eye, &target, &up);
assert_eq!(iso * eye, Point3::origin());
assert_relative_eq!(iso * Vector3::x(), Vector3::z());

Interpolates between two isometries using a linear interpolation for the translation part, and a spherical interpolation for the rotation part.

Panics if the angle between both rotations is 180 degrees (in which case the interpolation is not well-defined). Use .try_lerp_slerp instead to avoid the panic.

Examples:

let t1 = Translation3::new(1.0, 2.0, 3.0);
let t2 = Translation3::new(4.0, 8.0, 12.0);
let q1 = UnitQuaternion::from_euler_angles(std::f32::consts::FRAC_PI_4, 0.0, 0.0);
let q2 = UnitQuaternion::from_euler_angles(-std::f32::consts::PI, 0.0, 0.0);
let iso1 = Isometry3::from_parts(t1, q1);
let iso2 = Isometry3::from_parts(t2, q2);

let iso3 = iso1.lerp_slerp(&iso2, 1.0 / 3.0);

assert_eq!(iso3.translation.vector, Vector3::new(2.0, 4.0, 6.0));
assert_eq!(iso3.rotation.euler_angles(), (std::f32::consts::FRAC_PI_2, 0.0, 0.0));

Attempts to interpolate between two isometries using a linear interpolation for the translation part, and a spherical interpolation for the rotation part.

Retuns None if the angle between both rotations is 180 degrees (in which case the interpolation is not well-defined).

Examples:

let t1 = Translation3::new(1.0, 2.0, 3.0);
let t2 = Translation3::new(4.0, 8.0, 12.0);
let q1 = UnitQuaternion::from_euler_angles(std::f32::consts::FRAC_PI_4, 0.0, 0.0);
let q2 = UnitQuaternion::from_euler_angles(-std::f32::consts::PI, 0.0, 0.0);
let iso1 = Isometry3::from_parts(t1, q1);
let iso2 = Isometry3::from_parts(t2, q2);

let iso3 = iso1.lerp_slerp(&iso2, 1.0 / 3.0);

assert_eq!(iso3.translation.vector, Vector3::new(2.0, 4.0, 6.0));
assert_eq!(iso3.rotation.euler_angles(), (std::f32::consts::FRAC_PI_2, 0.0, 0.0));

Interpolates between two isometries using a linear interpolation for the translation part, and a spherical interpolation for the rotation part.

Panics if the angle between both rotations is 180 degrees (in which case the interpolation is not well-defined). Use .try_lerp_slerp instead to avoid the panic.

Examples:

let t1 = Translation3::new(1.0, 2.0, 3.0);
let t2 = Translation3::new(4.0, 8.0, 12.0);
let q1 = Rotation3::from_euler_angles(std::f32::consts::FRAC_PI_4, 0.0, 0.0);
let q2 = Rotation3::from_euler_angles(-std::f32::consts::PI, 0.0, 0.0);
let iso1 = IsometryMatrix3::from_parts(t1, q1);
let iso2 = IsometryMatrix3::from_parts(t2, q2);

let iso3 = iso1.lerp_slerp(&iso2, 1.0 / 3.0);

assert_eq!(iso3.translation.vector, Vector3::new(2.0, 4.0, 6.0));
assert_eq!(iso3.rotation.euler_angles(), (std::f32::consts::FRAC_PI_2, 0.0, 0.0));

Attempts to interpolate between two isometries using a linear interpolation for the translation part, and a spherical interpolation for the rotation part.

Retuns None if the angle between both rotations is 180 degrees (in which case the interpolation is not well-defined).

Examples:

let t1 = Translation3::new(1.0, 2.0, 3.0);
let t2 = Translation3::new(4.0, 8.0, 12.0);
let q1 = Rotation3::from_euler_angles(std::f32::consts::FRAC_PI_4, 0.0, 0.0);
let q2 = Rotation3::from_euler_angles(-std::f32::consts::PI, 0.0, 0.0);
let iso1 = IsometryMatrix3::from_parts(t1, q1);
let iso2 = IsometryMatrix3::from_parts(t2, q2);

let iso3 = iso1.lerp_slerp(&iso2, 1.0 / 3.0);

assert_eq!(iso3.translation.vector, Vector3::new(2.0, 4.0, 6.0));
assert_eq!(iso3.rotation.euler_angles(), (std::f32::consts::FRAC_PI_2, 0.0, 0.0));

Interpolates between two isometries using a linear interpolation for the translation part, and a spherical interpolation for the rotation part.

Panics if the angle between both rotations is 180 degrees (in which case the interpolation is not well-defined). Use .try_lerp_slerp instead to avoid the panic.

Examples:

let t1 = Translation2::new(1.0, 2.0);
let t2 = Translation2::new(4.0, 8.0);
let q1 = UnitComplex::new(std::f32::consts::FRAC_PI_4);
let q2 = UnitComplex::new(-std::f32::consts::PI);
let iso1 = Isometry2::from_parts(t1, q1);
let iso2 = Isometry2::from_parts(t2, q2);

let iso3 = iso1.lerp_slerp(&iso2, 1.0 / 3.0);

assert_eq!(iso3.translation.vector, Vector2::new(2.0, 4.0));
assert_relative_eq!(iso3.rotation.angle(), std::f32::consts::FRAC_PI_2);

Interpolates between two isometries using a linear interpolation for the translation part, and a spherical interpolation for the rotation part.

Panics if the angle between both rotations is 180 degrees (in which case the interpolation is not well-defined). Use .try_lerp_slerp instead to avoid the panic.

Examples:

let t1 = Translation2::new(1.0, 2.0);
let t2 = Translation2::new(4.0, 8.0);
let q1 = Rotation2::new(std::f32::consts::FRAC_PI_4);
let q2 = Rotation2::new(-std::f32::consts::PI);
let iso1 = IsometryMatrix2::from_parts(t1, q1);
let iso2 = IsometryMatrix2::from_parts(t2, q2);

let iso3 = iso1.lerp_slerp(&iso2, 1.0 / 3.0);

assert_eq!(iso3.translation.vector, Vector2::new(2.0, 4.0));
assert_relative_eq!(iso3.rotation.angle(), std::f32::consts::FRAC_PI_2);

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 AbsDiffEq::abs_diff_eq.
Performs an operation.
Performs specific operation.
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
Return an arbitrary value. Read more
Return an iterator of values that are smaller than itself. Read more
The archived representation of this type. Read more
The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type. Read more
Creates the archived version of this value at the given position and writes it to the given output. Read more
The error that may result from checking the type.
Checks whether the given pointer points to a valid value within the given context. 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
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
Deserializes using the given deserializer
Formats the value using the given formatter. Read more
Generate a random value of T, using rng as the source of randomness.
Create an iterator that generates random values of T, using rng as the source of randomness. Read more
Create a distribution of values of ‘S’ by mapping the output of Self through the closure F 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 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
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
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more

Creates a new identity isometry.

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 two_sided_inverse action on a point from the euclidean space.
Applies this group’s two_sided_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 RelativeEq::relative_eq.
Writes the dependencies for the object and returns a resolver that can create the archived type. Read more
Serialize this value into the given Serde serializer. Read more
The type of the elements of each lane of this SIMD value.
Type of the result of comparing two SIMD values like self.
The number of lanes of this SIMD value.
Initializes an SIMD value with each lanes set to val.
Extracts the i-th lane of self. Read more
Extracts the i-th lane of self without bound-checking.
Replaces the i-th lane of self by val. Read more
Replaces the i-th lane of self by val without bound-checking.
Merges self and other depending on the lanes of cond. Read more
Applies a function to each lane of self. Read more
Applies a function to each lane of self paired with the corresponding lane of b. 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
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
Returns the two_sided_inverse of self, relative to the operator O. Read more
In-place inversion of self, relative to the operator O. 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 UlpsEq::ulps_eq.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
The archived version of the pointer metadata for this type.
Converts some archived metadata to the pointer metadata for itself.
The archived counterpart of this type. Unlike Archive, it may be unsized. Read more
The resolver for the metadata of this type. Read more
Creates the archived version of the metadata for this value at the given position and writes it to the given output. Read more
Resolves a relative pointer to this value with the given from and to and writes it to the given output. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Deserializes using the given deserializer

Returns the argument unchanged.

Calls U::from(self).

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

The type for metadata in pointers and references to Self.
Should always be Self
Writes the object and returns the position of the archived type.
Serializes the metadata for the given type.
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 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.