pub struct Quaternion {
pub r: Fraction,
pub x: Fraction,
pub y: Fraction,
pub z: Fraction,
}
Fields§
§r: Fraction
Real component of the quaternion.
x: Fraction
i-component of the quaternion.
y: Fraction
j-component of the quaternion.
z: Fraction
k-component of the quaternion.
Implementations§
Source§impl Quaternion
impl Quaternion
Sourcepub fn new(r: Fraction, x: Fraction, y: Fraction, z: Fraction) -> Quaternion
pub fn new(r: Fraction, x: Fraction, y: Fraction, z: Fraction) -> Quaternion
Generates a new Quaternion
.
Sourcepub fn conjugate(&self) -> Quaternion
pub fn conjugate(&self) -> Quaternion
Returns the conjugate of the Quaternion
, another Quaternion
.
Sourcepub fn scale(&self, scale: Fraction) -> Quaternion
pub fn scale(&self, scale: Fraction) -> Quaternion
Scales the Quaternion
. Returns a new 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, other: Quaternion) -> Quaternion
fn add(self, other: Quaternion) -> Quaternion
Performs the
+
operation. Read moreSource§impl AddAssign for Quaternion
impl AddAssign for Quaternion
Source§fn add_assign(&mut self, other: Quaternion)
fn add_assign(&mut self, other: 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 · 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, other: Quaternion) -> Quaternion
fn div(self, other: Quaternion) -> Quaternion
Performs the
/
operation. Read moreSource§impl DivAssign for Quaternion
impl DivAssign for Quaternion
Source§fn div_assign(&mut self, other: Quaternion)
fn div_assign(&mut self, other: 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, other: Quaternion) -> Quaternion
fn mul(self, other: Quaternion) -> Quaternion
Performs the
*
operation. Read moreSource§impl MulAssign for Quaternion
impl MulAssign for Quaternion
Source§fn mul_assign(&mut self, other: Quaternion)
fn mul_assign(&mut self, other: 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 Ord for Quaternion
impl Ord for Quaternion
Source§fn cmp(&self, other: &Quaternion) -> Ordering
fn cmp(&self, other: &Quaternion) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for Quaternion
impl PartialEq for Quaternion
Source§impl PartialOrd for Quaternion
impl PartialOrd for Quaternion
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, other: Quaternion) -> Quaternion
fn sub(self, other: Quaternion) -> Quaternion
Performs the
-
operation. Read moreSource§impl SubAssign for Quaternion
impl SubAssign for Quaternion
Source§fn sub_assign(&mut self, other: Quaternion)
fn sub_assign(&mut self, other: Quaternion)
Performs the
-=
operation. Read moreimpl Copy 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