Struct cgmath::Quaternion

source ·
#[repr(C)]
pub struct Quaternion<S> { pub s: S, pub v: Vector3<S>, }
Expand description

A quaternion in scalar/vector form.

This type is marked as #[repr(C)].

Fields§

§s: S

The scalar part of the quaternion.

§v: Vector3<S>

The vector part of the quaternion.

Implementations§

source§

impl<S: BaseFloat> Quaternion<S>

source

pub fn new(w: S, xi: S, yj: S, zk: S) -> Quaternion<S>

Construct a new quaternion from one scalar component and three imaginary components

source

pub fn from_sv(s: S, v: Vector3<S>) -> Quaternion<S>

Construct a new quaternion from a scalar and a vector

source

pub fn from_arc( src: Vector3<S>, dst: Vector3<S>, fallback: Option<Vector3<S>> ) -> Quaternion<S>

Construct a new quaternion as a closest arc between two vectors

Return the closest rotation that turns src vector into dst.

  • [Related StackOverflow question] (http://stackoverflow.com/questions/1171849/finding-quaternion-representing-the-rotation-from-one-vector-to-another)
  • [Ogre implementation for normalized vectors] (https://bitbucket.org/sinbad/ogre/src/9db75e3ba05c/OgreMain/include/OgreVector3.h?fileviewer=file-view-default#cl-651)
source

pub fn conjugate(self) -> Quaternion<S>

The conjugate of the quaternion.

source

pub fn nlerp(self, other: Quaternion<S>, amount: S) -> Quaternion<S>

Do a normalized linear interpolation with other, by amount.

source

pub fn slerp(self, other: Quaternion<S>, amount: S) -> Quaternion<S>

Spherical Linear Intoperlation

Return the spherical linear interpolation between the quaternion and other. Both quaternions should be normalized first.

Performance notes

The acos operation used in slerp is an expensive operation, so unless your quarternions are far away from each other it’s generally more advisable to use nlerp when you know your rotations are going to be small.

  • [Understanding Slerp, Then Not Using It] (http://number-none.com/product/Understanding%20Slerp,%20Then%20Not%20Using%20It/)
  • [Arcsynthesis OpenGL tutorial] (http://www.arcsynthesis.org/gltut/Positioning/Tut08%20Interpolation.html)

Trait Implementations§

source§

impl<'a, 'b, S: BaseFloat> Add<&'a Quaternion<S>> for &'b Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the + operator.
source§

fn add(self, other: &'a Quaternion<S>) -> Quaternion<S>

Performs the + operation. Read more
source§

impl<'a, S: BaseFloat> Add<&'a Quaternion<S>> for Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the + operator.
source§

fn add(self, other: &'a Quaternion<S>) -> Quaternion<S>

Performs the + operation. Read more
source§

impl<'a, S: BaseFloat> Add<Quaternion<S>> for &'a Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the + operator.
source§

fn add(self, other: Quaternion<S>) -> Quaternion<S>

Performs the + operation. Read more
source§

impl<S: BaseFloat> Add<Quaternion<S>> for Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the + operator.
source§

fn add(self, other: Quaternion<S>) -> Quaternion<S>

Performs the + operation. Read more
source§

impl<S: BaseFloat + AddAssign<S>> AddAssign<Quaternion<S>> for Quaternion<S>

source§

fn add_assign(&mut self, other: Quaternion<S>)

Performs the += operation. Read more
source§

impl<S: BaseFloat> ApproxEq for Quaternion<S>

§

type Epsilon = <S as ApproxEq>::Epsilon

Used for specifying relative comparisons.
source§

fn default_epsilon() -> S::Epsilon

The default tolerance to use when testing values that are close together. Read more
source§

fn default_max_relative() -> S::Epsilon

The default relative tolerance for testing values that are far-apart. Read more
source§

fn default_max_ulps() -> u32

The default ULPs to tolerate when testing values that are far-apart. Read more
source§

fn relative_eq( &self, other: &Self, epsilon: S::Epsilon, max_relative: S::Epsilon ) -> bool

A test for equality that uses a relative comparison if the values are far apart.
source§

fn ulps_eq(&self, other: &Self, epsilon: S::Epsilon, max_ulps: u32) -> bool

A test for equality that uses units in the last place (ULP) if the values are far apart.
source§

fn relative_ne( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool

The inverse of ApproxEq::relative_eq.
source§

fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool

The inverse of ApproxEq::ulps_eq.
source§

impl<S: BaseFloat> AsMut<[S; 4]> for Quaternion<S>

source§

fn as_mut(&mut self) -> &mut [S; 4]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<S: BaseFloat> AsMut<(S, S, S, S)> for Quaternion<S>

source§

fn as_mut(&mut self) -> &mut (S, S, S, S)

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<S: BaseFloat> AsRef<[S; 4]> for Quaternion<S>

source§

fn as_ref(&self) -> &[S; 4]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<S: BaseFloat> AsRef<(S, S, S, S)> for Quaternion<S>

source§

fn as_ref(&self) -> &(S, S, S, S)

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<S: Clone> Clone for Quaternion<S>

source§

fn clone(&self) -> Quaternion<S>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<S: Debug> Debug for Quaternion<S>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<S: Decodable> Decodable for Quaternion<S>

source§

fn decode<__D: Decoder>(d: &mut __D) -> Result<Quaternion<S>, __D::Error>

Deserialize a value using a Decoder.
source§

impl<'a> Div<&'a Quaternion<f32>> for f32

§

type Output = Quaternion<f32>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Quaternion<f32>) -> Quaternion<f32>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Quaternion<f64>> for f64

§

type Output = Quaternion<f64>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Quaternion<f64>) -> Quaternion<f64>

Performs the / operation. Read more
source§

impl Div<Quaternion<f32>> for f32

§

type Output = Quaternion<f32>

The resulting type after applying the / operator.
source§

fn div(self, other: Quaternion<f32>) -> Quaternion<f32>

Performs the / operation. Read more
source§

impl Div<Quaternion<f64>> for f64

§

type Output = Quaternion<f64>

The resulting type after applying the / operator.
source§

fn div(self, other: Quaternion<f64>) -> Quaternion<f64>

Performs the / operation. Read more
source§

impl<'a, S: BaseFloat> Div<S> for &'a Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the / operator.
source§

fn div(self, other: S) -> Quaternion<S>

Performs the / operation. Read more
source§

impl<S: BaseFloat> Div<S> for Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the / operator.
source§

fn div(self, other: S) -> Quaternion<S>

Performs the / operation. Read more
source§

impl<S: BaseFloat + DivAssign<S>> DivAssign<S> for Quaternion<S>

source§

fn div_assign(&mut self, scalar: S)

Performs the /= operation. Read more
source§

impl<S: Encodable> Encodable for Quaternion<S>

source§

fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>

Serialize a value using an Encoder.
source§

impl<'a, S: BaseFloat> From<&'a [S; 4]> for &'a Quaternion<S>

source§

fn from(v: &'a [S; 4]) -> &'a Quaternion<S>

Converts to this type from the input type.
source§

impl<'a, S: BaseFloat> From<&'a (S, S, S, S)> for &'a Quaternion<S>

source§

fn from(v: &'a (S, S, S, S)) -> &'a Quaternion<S>

Converts to this type from the input type.
source§

impl<'a, S: BaseFloat> From<&'a mut [S; 4]> for &'a mut Quaternion<S>

source§

fn from(v: &'a mut [S; 4]) -> &'a mut Quaternion<S>

Converts to this type from the input type.
source§

impl<'a, S: BaseFloat> From<&'a mut (S, S, S, S)> for &'a mut Quaternion<S>

source§

fn from(v: &'a mut (S, S, S, S)) -> &'a mut Quaternion<S>

Converts to this type from the input type.
source§

impl<S: BaseFloat> From<[S; 4]> for Quaternion<S>

source§

fn from(v: [S; 4]) -> Quaternion<S>

Converts to this type from the input type.
source§

impl<S: BaseFloat> From<(S, S, S, S)> for Quaternion<S>

source§

fn from(v: (S, S, S, S)) -> Quaternion<S>

Converts to this type from the input type.
source§

impl<S: BaseFloat> From<Basis3<S>> for Quaternion<S>

source§

fn from(b: Basis3<S>) -> Quaternion<S>

Converts to this type from the input type.
source§

impl<A> From<Euler<A>> for Quaternion<<A as Angle>::Unitless>where A: Angle + Into<Rad<<A as Angle>::Unitless>>,

source§

fn from(src: Euler<A>) -> Quaternion<A::Unitless>

Converts to this type from the input type.
source§

impl<S: BaseFloat> From<Matrix3<S>> for Quaternion<S>

source§

fn from(mat: Matrix3<S>) -> Quaternion<S>

Convert the matrix to a quaternion

source§

impl<S: BaseFloat> From<Quaternion<S>> for Basis3<S>

source§

fn from(quat: Quaternion<S>) -> Basis3<S>

Converts to this type from the input type.
source§

impl<S: BaseFloat> From<Quaternion<S>> for Euler<Rad<S>>

source§

fn from(src: Quaternion<S>) -> Euler<Rad<S>>

Converts to this type from the input type.
source§

impl<S: BaseFloat> From<Quaternion<S>> for Matrix3<S>

source§

fn from(quat: Quaternion<S>) -> Matrix3<S>

Convert the quaternion to a 3 x 3 rotation matrix

source§

impl<S: BaseFloat> From<Quaternion<S>> for Matrix4<S>

source§

fn from(quat: Quaternion<S>) -> Matrix4<S>

Convert the quaternion to a 4 x 4 rotation matrix

source§

impl<S: BaseFloat> Index<Range<usize>> for Quaternion<S>

§

type Output = [S]

The returned type after indexing.
source§

fn index<'a>(&'a self, i: Range<usize>) -> &'a [S]

Performs the indexing (container[index]) operation. Read more
source§

impl<S: BaseFloat> Index<RangeFrom<usize>> for Quaternion<S>

§

type Output = [S]

The returned type after indexing.
source§

fn index<'a>(&'a self, i: RangeFrom<usize>) -> &'a [S]

Performs the indexing (container[index]) operation. Read more
source§

impl<S: BaseFloat> Index<RangeFull> for Quaternion<S>

§

type Output = [S]

The returned type after indexing.
source§

fn index<'a>(&'a self, i: RangeFull) -> &'a [S]

Performs the indexing (container[index]) operation. Read more
source§

impl<S: BaseFloat> Index<RangeTo<usize>> for Quaternion<S>

§

type Output = [S]

The returned type after indexing.
source§

fn index<'a>(&'a self, i: RangeTo<usize>) -> &'a [S]

Performs the indexing (container[index]) operation. Read more
source§

impl<S: BaseFloat> Index<usize> for Quaternion<S>

§

type Output = S

The returned type after indexing.
source§

fn index<'a>(&'a self, i: usize) -> &'a S

Performs the indexing (container[index]) operation. Read more
source§

impl<S: BaseFloat> IndexMut<Range<usize>> for Quaternion<S>

source§

fn index_mut<'a>(&'a mut self, i: Range<usize>) -> &'a mut [S]

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<S: BaseFloat> IndexMut<RangeFrom<usize>> for Quaternion<S>

source§

fn index_mut<'a>(&'a mut self, i: RangeFrom<usize>) -> &'a mut [S]

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<S: BaseFloat> IndexMut<RangeFull> for Quaternion<S>

source§

fn index_mut<'a>(&'a mut self, i: RangeFull) -> &'a mut [S]

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<S: BaseFloat> IndexMut<RangeTo<usize>> for Quaternion<S>

source§

fn index_mut<'a>(&'a mut self, i: RangeTo<usize>) -> &'a mut [S]

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<S: BaseFloat> IndexMut<usize> for Quaternion<S>

source§

fn index_mut<'a>(&'a mut self, i: usize) -> &'a mut S

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<S: BaseFloat> InnerSpace for Quaternion<S>

source§

fn dot(self, other: Quaternion<S>) -> S

Vector dot (or inner) product.
source§

fn is_perpendicular(self, other: Self) -> bool

Returns true if the vector is perpendicular (at right angles) to the other vector.
source§

fn magnitude2(self) -> Self::Scalar

Returns the squared magnitude. Read more
source§

fn magnitude(self) -> Self::Scalar

The distance from the tail to the tip of the vector.
source§

fn angle(self, other: Self) -> Rad<Self::Scalar>

Returns the angle between two vectors in radians.
source§

fn normalize(self) -> Self

Returns a vector with the same direction, but with a magnitude of 1.
source§

fn normalize_to(self, magnitude: Self::Scalar) -> Self

Returns a vector with the same direction and a given magnitude.
source§

fn lerp(self, other: Self, amount: Self::Scalar) -> Self

Returns the result of linearly interpolating the magnitude of the vector towards the magnitude of other by the specified amount.
source§

impl<S: BaseFloat> Into<[S; 4]> for Quaternion<S>

source§

fn into(self) -> [S; 4]

Converts this type into the (usually inferred) input type.
source§

impl<S: BaseFloat> Into<(S, S, S, S)> for Quaternion<S>

source§

fn into(self) -> (S, S, S, S)

Converts this type into the (usually inferred) input type.
source§

impl<S: BaseFloat> MetricSpace for Quaternion<S>

§

type Metric = S

The metric to be returned by the distance function.
source§

fn distance2(self, other: Self) -> S

Returns the squared distance. Read more
source§

fn distance(self, other: Self) -> Self::Metric

The distance between two values.
source§

impl<'a, 'b, S: BaseFloat> Mul<&'a Quaternion<S>> for &'b Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Quaternion<S>) -> Quaternion<S>

Performs the * operation. Read more
source§

impl<'a, S: BaseFloat> Mul<&'a Quaternion<S>> for Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Quaternion<S>) -> Quaternion<S>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Quaternion<f32>> for f32

§

type Output = Quaternion<f32>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Quaternion<f32>) -> Quaternion<f32>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Quaternion<f64>> for f64

§

type Output = Quaternion<f64>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Quaternion<f64>) -> Quaternion<f64>

Performs the * operation. Read more
source§

impl<'a, 'b, S: BaseFloat> Mul<&'a Vector3<S>> for &'b Quaternion<S>

§

type Output = Vector3<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Vector3<S>) -> Vector3<S>

Performs the * operation. Read more
source§

impl<'a, S: BaseFloat> Mul<&'a Vector3<S>> for Quaternion<S>

§

type Output = Vector3<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Vector3<S>) -> Vector3<S>

Performs the * operation. Read more
source§

impl<'a, S: BaseFloat> Mul<Quaternion<S>> for &'a Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: Quaternion<S>) -> Quaternion<S>

Performs the * operation. Read more
source§

impl<S: BaseFloat> Mul<Quaternion<S>> for Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: Quaternion<S>) -> Quaternion<S>

Performs the * operation. Read more
source§

impl Mul<Quaternion<f32>> for f32

§

type Output = Quaternion<f32>

The resulting type after applying the * operator.
source§

fn mul(self, other: Quaternion<f32>) -> Quaternion<f32>

Performs the * operation. Read more
source§

impl Mul<Quaternion<f64>> for f64

§

type Output = Quaternion<f64>

The resulting type after applying the * operator.
source§

fn mul(self, other: Quaternion<f64>) -> Quaternion<f64>

Performs the * operation. Read more
source§

impl<'a, S: BaseFloat> Mul<S> for &'a Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: S) -> Quaternion<S>

Performs the * operation. Read more
source§

impl<S: BaseFloat> Mul<S> for Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: S) -> Quaternion<S>

Performs the * operation. Read more
source§

impl<'a, S: BaseFloat> Mul<Vector3<S>> for &'a Quaternion<S>

§

type Output = Vector3<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: Vector3<S>) -> Vector3<S>

Performs the * operation. Read more
source§

impl<S: BaseFloat> Mul<Vector3<S>> for Quaternion<S>

§

type Output = Vector3<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: Vector3<S>) -> Vector3<S>

Performs the * operation. Read more
source§

impl<S: BaseFloat + MulAssign<S>> MulAssign<S> for Quaternion<S>

source§

fn mul_assign(&mut self, scalar: S)

Performs the *= operation. Read more
source§

impl<'a, S: BaseFloat> Neg for &'a Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the - operator.
source§

fn neg(self) -> Quaternion<S>

Performs the unary - operation. Read more
source§

impl<S: BaseFloat> Neg for Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the - operator.
source§

fn neg(self) -> Quaternion<S>

Performs the unary - operation. Read more
source§

impl<S: BaseFloat> One for Quaternion<S>

source§

fn one() -> Quaternion<S>

Returns the multiplicative identity element of Self, 1. Read more
source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
source§

fn is_one(&self) -> boolwhere Self: PartialEq<Self>,

Returns true if self is equal to the multiplicative identity. Read more
source§

impl<S: PartialEq> PartialEq<Quaternion<S>> for Quaternion<S>

source§

fn eq(&self, other: &Quaternion<S>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: BaseFloat + Rand> Rand for Quaternion<S>

source§

fn rand<R: Rng>(rng: &mut R) -> Quaternion<S>

Generates a random instance of this type using the specified source of randomness.
source§

impl<'a, S: BaseFloat> Rem<S> for &'a Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the % operator.
source§

fn rem(self, other: S) -> Quaternion<S>

Performs the % operation. Read more
source§

impl<S: BaseFloat> Rem<S> for Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the % operator.
source§

fn rem(self, other: S) -> Quaternion<S>

Performs the % operation. Read more
source§

impl<S: BaseFloat + RemAssign<S>> RemAssign<S> for Quaternion<S>

source§

fn rem_assign(&mut self, scalar: S)

Performs the %= operation. Read more
source§

impl<S: BaseFloat> Rotation<Point3<S>> for Quaternion<S>

source§

fn look_at(dir: Vector3<S>, up: Vector3<S>) -> Quaternion<S>

Create a rotation to a given direction with an ‘up’ vector
source§

fn between_vectors(a: Vector3<S>, b: Vector3<S>) -> Quaternion<S>

Create a shortest rotation to transform vector ‘a’ into ‘b’. Both given vectors are assumed to have unit length.
source§

fn rotate_vector(&self, vec: Vector3<S>) -> Vector3<S>

Rotate a vector using this rotation.
source§

fn invert(&self) -> Quaternion<S>

Create a new rotation which “un-does” this rotation. That is, r * r.invert() is the identity.
source§

fn rotate_point(&self, point: P) -> P

Rotate a point using this rotation, by converting it to its representation as a vector.
source§

impl<S: BaseFloat> Rotation3<S> for Quaternion<S>

source§

fn from_axis_angle<A: Into<Rad<S>>>(axis: Vector3<S>, angle: A) -> Quaternion<S>

Create a rotation using an angle around a given axis. Read more
source§

fn from_angle_x<A: Into<Rad<S>>>(theta: A) -> Self

Create a rotation from an angle around the x axis (pitch).
source§

fn from_angle_y<A: Into<Rad<S>>>(theta: A) -> Self

Create a rotation from an angle around the y axis (yaw).
source§

fn from_angle_z<A: Into<Rad<S>>>(theta: A) -> Self

Create a rotation from an angle around the z axis (roll).
source§

impl<'a, 'b, S: BaseFloat> Sub<&'a Quaternion<S>> for &'b Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the - operator.
source§

fn sub(self, other: &'a Quaternion<S>) -> Quaternion<S>

Performs the - operation. Read more
source§

impl<'a, S: BaseFloat> Sub<&'a Quaternion<S>> for Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the - operator.
source§

fn sub(self, other: &'a Quaternion<S>) -> Quaternion<S>

Performs the - operation. Read more
source§

impl<'a, S: BaseFloat> Sub<Quaternion<S>> for &'a Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the - operator.
source§

fn sub(self, other: Quaternion<S>) -> Quaternion<S>

Performs the - operation. Read more
source§

impl<S: BaseFloat> Sub<Quaternion<S>> for Quaternion<S>

§

type Output = Quaternion<S>

The resulting type after applying the - operator.
source§

fn sub(self, other: Quaternion<S>) -> Quaternion<S>

Performs the - operation. Read more
source§

impl<S: BaseFloat + SubAssign<S>> SubAssign<Quaternion<S>> for Quaternion<S>

source§

fn sub_assign(&mut self, other: Quaternion<S>)

Performs the -= operation. Read more
source§

impl<S: BaseFloat> VectorSpace for Quaternion<S>

§

type Scalar = S

The associated scalar.
source§

impl<S: BaseFloat> Zero for Quaternion<S>

source§

fn zero() -> Quaternion<S>

Returns the additive identity element of Self, 0. Read more
source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
source§

impl<S: Copy> Copy for Quaternion<S>

source§

impl<S> StructuralPartialEq for Quaternion<S>

Auto Trait Implementations§

§

impl<S> RefUnwindSafe for Quaternion<S>where S: RefUnwindSafe,

§

impl<S> Send for Quaternion<S>where S: Send,

§

impl<S> Sync for Quaternion<S>where S: Sync,

§

impl<S> Unpin for Quaternion<S>where S: Unpin,

§

impl<S> UnwindSafe for Quaternion<S>where S: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T, Rhs> NumAssignOps<Rhs> for Twhere T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for Twhere T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,