Struct static_math::quaternion::Quaternion [−][src]
pub struct Quaternion<T> { /* fields omitted */ }
Expand description
Quaternion type
Implementations
impl<T> Quaternion<T>
[src]
impl<T> Quaternion<T>
[src]impl<T: Num + Copy> Quaternion<T>
[src]
impl<T: Num + Copy> Quaternion<T>
[src]pub fn one() -> Quaternion<T>
[src]
pub fn one() -> Quaternion<T>
[src]construct a unit Quaternion
pub fn new_from_vec(v: &V4<T>) -> Self
[src]
pub fn new_from_vec(v: &V4<T>) -> Self
[src]Construct a new Quternion from a V4
pub fn to_rotation(&self) -> M33<T>
[src]
pub fn to_rotation(&self) -> M33<T>
[src]convert the Quaternion to a rotation matrix
impl<T: Float + Sum> Quaternion<T>
[src]
impl<T: Float + Sum> Quaternion<T>
[src]pub fn from_rotation(rot: &M33<T>) -> Self
[src]
impl<T: Float> Quaternion<T>
[src]
impl<T: Float> Quaternion<T>
[src]pub fn rotation(theta: T, v: &V3<T>) -> Self
[src]
pub fn rotation(theta: T, v: &V3<T>) -> Self
[src]generate a Quaternion that represents a rotation of a angle theta
around the axis(normalized) v
pub fn rotation_norm_encoded(v: &V3<T>) -> Self
[src]
pub fn rotation_norm_encoded(v: &V3<T>) -> Self
[src]generate a Quaternion that represents a rotation of a angle theta
around the axis(normalized) v
, the angle theta
is encoded in the
norm of the vector v
pub fn from_euler_angles(yay: T, pitch: T, roll: T) -> Self
[src]
pub fn from_euler_angles(yay: T, pitch: T, roll: T) -> Self
[src]create a quaternion that represents the rotation from a Euler angles with the roll-pitch-yay convention
pub fn get_axis(&self) -> Option<V3<T>>
[src]
pub fn get_axis(&self) -> Option<V3<T>>
[src]get the axis of rotation from which this Quaternion represent
pub fn axis_angle(&self) -> (Option<V3<T>>, T)
[src]
pub fn axis_angle(&self) -> (Option<V3<T>>, T)
[src]combine the two previous methods: get_axis
and get_angle
pub fn normalize_q(&self) -> Self
[src]
pub fn normalize_q(&self) -> Self
[src]normalize the Quaternion
pub fn slerp(a: Self, b: Self, t: T) -> Self
[src]
pub fn slerp(a: Self, b: Self, t: T) -> Self
[src]Brief.
Spherical Linear Interpolation between two Quaternions this implementation follow this implementations: https://www.mrpt.org/tutorials/programming/maths-and-geometry/slerp-interpolation/
Function arguments:
a
: Quaternion(normalized)
b
: Quaternion(normalized)
t
: Float in the closed interval [0.0, 1.0]
pub fn derivative(&self, rate: &V3<T>) -> Self
[src]
pub fn derivative(&self, rate: &V3<T>) -> Self
[src]Brief.
calculate the instantaneous Quaternion derivative representing a Quaternion rotating at rate given by a vector rate
Function arguments:
rate
: V3
impl<T: Float + Signed> Quaternion<T>
[src]
impl<T: Float + Signed> Quaternion<T>
[src]impl<T: Float + FloatConst> Quaternion<T>
[src]
impl<T: Float + FloatConst> Quaternion<T>
[src]pub fn to_euler_angles(&self) -> (T, T, T)
[src]
pub fn to_euler_angles(&self) -> (T, T, T)
[src]get the euler angles from the Quaternion
Trait Implementations
impl<T: Num + Copy> Add<Quaternion<T>> for Quaternion<T>
[src]
impl<T: Num + Copy> Add<Quaternion<T>> for Quaternion<T>
[src]impl<T: Clone> Clone for Quaternion<T>
[src]
impl<T: Clone> Clone for Quaternion<T>
[src]fn clone(&self) -> Quaternion<T>
[src]
fn clone(&self) -> Quaternion<T>
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl<T: Debug> Debug for Quaternion<T>
[src]
impl<T: Debug> Debug for Quaternion<T>
[src]impl<T: Num + Display> Display for Quaternion<T>
[src]
impl<T: Num + Display> Display for Quaternion<T>
[src]impl<T: Float + Signed> Div<Quaternion<T>> for Quaternion<T>
[src]
impl<T: Float + Signed> Div<Quaternion<T>> for Quaternion<T>
[src]impl<T: Num + Copy> Div<T> for Quaternion<T>
[src]
impl<T: Num + Copy> Div<T> for Quaternion<T>
[src]impl<T: Copy> From<[T; 4]> for Quaternion<T>
[src]
impl<T: Copy> From<[T; 4]> for Quaternion<T>
[src]fn from(data: [T; 4]) -> Quaternion<T>
[src]
fn from(data: [T; 4]) -> Quaternion<T>
[src]Performs the conversion.
impl<T: Num + Copy> Mul<Quaternion<T>> for Quaternion<T>
[src]
impl<T: Num + Copy> Mul<Quaternion<T>> for Quaternion<T>
[src]impl<T: Num + Copy> Mul<T> for Quaternion<T>
[src]
impl<T: Num + Copy> Mul<T> for Quaternion<T>
[src]impl<T: Num + Copy> One for Quaternion<T>
[src]
impl<T: Num + Copy> One for Quaternion<T>
[src]impl<T: PartialEq> PartialEq<Quaternion<T>> for Quaternion<T>
[src]
impl<T: PartialEq> PartialEq<Quaternion<T>> for Quaternion<T>
[src]fn eq(&self, other: &Quaternion<T>) -> bool
[src]
fn eq(&self, other: &Quaternion<T>) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &Quaternion<T>) -> bool
[src]
fn ne(&self, other: &Quaternion<T>) -> bool
[src]This method tests for !=
.
impl<T: Num + Copy> Sub<Quaternion<T>> for Quaternion<T>
[src]
impl<T: Num + Copy> Sub<Quaternion<T>> for Quaternion<T>
[src]impl<T: Num + Copy> Zero for Quaternion<T>
[src]
impl<T: Num + Copy> Zero for Quaternion<T>
[src]impl<T: Copy> Copy for Quaternion<T>
[src]
impl<T> StructuralPartialEq for Quaternion<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Quaternion<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Quaternion<T> where
T: Send,
T: Send,
impl<T> Sync for Quaternion<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Quaternion<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Quaternion<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more