pub enum Rotation {
Quaternion(UnitQuaternion<f64>),
Rpy(Vector3<f64>),
}Expand description
Unified representation for rotations, allowing different input formats.
Variants§
Quaternion(UnitQuaternion<f64>)
Quaternion representation (x, y, z, w).
Rpy(Vector3<f64>)
Roll-Pitch-Yaw (Euler angles in radians, ZYX convention).
Implementations§
Source§impl Rotation
impl Rotation
Sourcepub fn from_quaternion(x: f64, y: f64, z: f64, w: f64) -> Self
pub fn from_quaternion(x: f64, y: f64, z: f64, w: f64) -> Self
Creates a Rotation from a quaternion (x, y, z, w).
Sourcepub const fn from_rpy(roll: f64, pitch: f64, yaw: f64) -> Self
pub const fn from_rpy(roll: f64, pitch: f64, yaw: f64) -> Self
Creates a Rotation from RPY angles in radians (roll, pitch, yaw).
Sourcepub fn as_quaternion(&self) -> UnitQuaternion<f64>
pub fn as_quaternion(&self) -> UnitQuaternion<f64>
Converts this rotation to a UnitQuaternion.
Trait Implementations§
Source§impl From<Unit<Quaternion<f64>>> for Rotation
impl From<Unit<Quaternion<f64>>> for Rotation
Source§fn from(q: UnitQuaternion<f64>) -> Self
fn from(q: UnitQuaternion<f64>) -> Self
Converts to this type from the input type.
impl Copy for Rotation
Auto Trait Implementations§
impl Freeze for Rotation
impl RefUnwindSafe for Rotation
impl Send for Rotation
impl Sync for Rotation
impl Unpin for Rotation
impl UnwindSafe for Rotation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.