pub struct Quaternion {
pub w: f64,
pub x: f64,
pub y: f64,
pub z: f64,
}Fields§
§w: f64§x: f64§y: f64§z: f64Implementations§
Source§impl Quaternion
impl Quaternion
pub fn new(w: f64, x: f64, y: f64, z: f64) -> Quaternion
pub fn identity() -> Quaternion
pub fn zero() -> Quaternion
pub fn pure(x: f64, y: f64, z: f64) -> Quaternion
pub fn from_axis_angle(axis: [f64; 3], angle: f64) -> Quaternion
pub fn from_euler(roll: f64, pitch: f64, yaw: f64) -> Quaternion
pub fn to_axis_angle(&self) -> ([f64; 3], f64)
pub fn to_rotation_matrix(&self) -> [[f64; 3]; 3]
pub fn conj(&self) -> Quaternion
pub fn norm_sq(&self) -> f64
pub fn norm(&self) -> f64
pub fn normalize(&self) -> Quaternion
pub fn inv(&self) -> Quaternion
pub fn rotate_vector(&self, v: [f64; 3]) -> [f64; 3]
pub fn dot(&self, other: &Quaternion) -> f64
pub fn slerp(&self, other: &Quaternion, t: f64) -> Quaternion
pub fn scale(&self, s: f64) -> Quaternion
pub fn exp(&self) -> Quaternion
pub fn ln(&self) -> Quaternion
Trait Implementations§
Source§impl Add for Quaternion
impl Add for Quaternion
Source§type Output = Quaternion
type Output = Quaternion
The resulting type after applying the
+ operator.Source§fn add(self, rhs: Quaternion) -> Quaternion
fn add(self, rhs: Quaternion) -> Quaternion
Performs the
+ operation. Read moreSource§impl Clone for Quaternion
impl Clone for Quaternion
Source§fn clone(&self) -> Quaternion
fn clone(&self) -> Quaternion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Quaternion
impl Debug for Quaternion
Source§impl Display for Quaternion
impl Display for Quaternion
Source§impl Div for Quaternion
impl Div for Quaternion
Source§type Output = Quaternion
type Output = Quaternion
The resulting type after applying the
/ operator.Source§fn div(self, rhs: Quaternion) -> Quaternion
fn div(self, rhs: Quaternion) -> Quaternion
Performs the
/ operation. Read moreSource§impl Mul for Quaternion
impl Mul for Quaternion
Source§type Output = Quaternion
type Output = Quaternion
The resulting type after applying the
* operator.Source§fn mul(self, rhs: Quaternion) -> Quaternion
fn mul(self, rhs: Quaternion) -> Quaternion
Performs the
* operation. Read moreSource§impl Neg for Quaternion
impl Neg for Quaternion
Source§type Output = Quaternion
type Output = Quaternion
The resulting type after applying the
- operator.Source§fn neg(self) -> Quaternion
fn neg(self) -> Quaternion
Performs the unary
- operation. Read moreSource§impl PartialEq for Quaternion
impl PartialEq for Quaternion
Source§fn eq(&self, other: &Quaternion) -> bool
fn eq(&self, other: &Quaternion) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Sub for Quaternion
impl Sub for Quaternion
Source§type Output = Quaternion
type Output = Quaternion
The resulting type after applying the
- operator.Source§fn sub(self, rhs: Quaternion) -> Quaternion
fn sub(self, rhs: Quaternion) -> Quaternion
Performs the
- operation. Read moreimpl Copy for Quaternion
impl StructuralPartialEq 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 UnsafeUnpin 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