pub struct Quaternion { /* private fields */ }
Expand description
A quaternion.
Wrapper around C++ implementation maliput::math::Quaternion
.
Implementations§
Source§impl Quaternion
impl Quaternion
Sourcepub fn new(w: f64, x: f64, y: f64, z: f64) -> Quaternion
pub fn new(w: f64, x: f64, y: f64, z: f64) -> Quaternion
Create a new Quaternion
with the given w
, x
, y
, and z
components.
The w
component is the real part of the quaternion.
The x
, y
, and z
components are the imaginary parts of the quaternion.
Sourcepub fn dot(&self, other: &Quaternion) -> f64
pub fn dot(&self, other: &Quaternion) -> f64
Get the dot product of the Quaternion
with another Quaternion
.
Sourcepub fn angular_distance(&self, other: &Quaternion) -> f64
pub fn angular_distance(&self, other: &Quaternion) -> f64
Get the angular distance between the Quaternion
and another Quaternion
.
Sourcepub fn squared_norm(&self) -> f64
pub fn squared_norm(&self) -> f64
Get the squared norm of the Quaternion
.
Sourcepub fn inverse(&self) -> Quaternion
pub fn inverse(&self) -> Quaternion
Get the inverse of the Quaternion
.
Sourcepub fn conjugate(&self) -> Quaternion
pub fn conjugate(&self) -> Quaternion
Get the conjugate of the Quaternion
.
Sourcepub fn to_rotation_matrix(&self) -> Matrix3
pub fn to_rotation_matrix(&self) -> Matrix3
Get the rotation matrix representation of the Quaternion
.
Sourcepub fn transform_vector(&self, v: &Vector3) -> Vector3
pub fn transform_vector(&self, v: &Vector3) -> Vector3
Apply the Quaternion
to a Vector3
.
Trait Implementations§
Source§impl Debug for Quaternion
impl Debug for Quaternion
Source§impl Display for Quaternion
impl Display for Quaternion
Source§impl PartialEq for Quaternion
impl PartialEq for Quaternion
impl Eq for Quaternion
Auto Trait Implementations§
impl Freeze for Quaternion
impl RefUnwindSafe for Quaternion
impl !Send for Quaternion
impl !Sync for Quaternion
impl Unpin for Quaternion
impl UnwindSafe for Quaternion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more