Struct cgmath::Quaternion
source · #[repr(C)]pub struct Quaternion<S> {
pub v: Vector3<S>,
pub s: S,
}
Expand description
A quaternion in scalar/vector form.
This type is marked as #[repr(C)]
.
Fields§
§v: Vector3<S>
The vector part of the quaternion.
s: S
The scalar part of the quaternion.
Implementations§
source§impl<S> Quaternion<S>
impl<S> Quaternion<S>
sourcepub const fn new(w: S, xi: S, yj: S, zk: S) -> Quaternion<S>
pub const fn new(w: S, xi: S, yj: S, zk: S) -> Quaternion<S>
Construct a new quaternion from one scalar component and three imaginary components.
sourcepub const fn from_sv(s: S, v: Vector3<S>) -> Quaternion<S>
pub const fn from_sv(s: S, v: Vector3<S>) -> Quaternion<S>
Construct a new quaternion from a scalar and a vector.
source§impl<S: BaseFloat> Quaternion<S>
impl<S: BaseFloat> Quaternion<S>
sourcepub fn from_arc(
src: Vector3<S>,
dst: Vector3<S>,
fallback: Option<Vector3<S>>
) -> Quaternion<S>
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)
sourcepub fn conjugate(self) -> Quaternion<S>
pub fn conjugate(self) -> Quaternion<S>
The conjugate of the quaternion.
sourcepub fn nlerp(self, other: Quaternion<S>, amount: S) -> Quaternion<S>
pub fn nlerp(self, other: Quaternion<S>, amount: S) -> Quaternion<S>
Do a normalized linear interpolation with other
, by amount
.
This takes the shortest path, so if the quaternions have a negative
dot product, the interpolation will be between self
and -other
.
sourcepub fn slerp(self, other: Quaternion<S>, amount: S) -> Quaternion<S>
pub fn slerp(self, other: Quaternion<S>, amount: S) -> Quaternion<S>
Spherical Linear Interpolation
Return the spherical linear interpolation between the quaternion and
other
. Both quaternions should be normalized first.
This takes the shortest path, so if the quaternions have a negative
dot product, the interpolation will be between self
and -other
.
Performance notes
The acos
operation used in slerp
is an expensive operation, so
unless your quaternions 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)
pub fn is_finite(&self) -> bool
source§impl<S: NumCast + Copy> Quaternion<S>
impl<S: NumCast + Copy> Quaternion<S>
sourcepub fn cast<T: BaseFloat>(&self) -> Option<Quaternion<T>>
pub fn cast<T: BaseFloat>(&self) -> Option<Quaternion<T>>
Component-wise casting to another type.
Trait Implementations§
source§impl<S: BaseFloat> AbsDiffEq<Quaternion<S>> for Quaternion<S>
impl<S: BaseFloat> AbsDiffEq<Quaternion<S>> for Quaternion<S>
source§fn default_epsilon() -> S::Epsilon
fn default_epsilon() -> S::Epsilon
source§fn abs_diff_eq(&self, other: &Self, epsilon: S::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: S::Epsilon) -> bool
source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
AbsDiffEq::abs_diff_eq
.source§impl<'a, 'b, S: BaseFloat> Add<&'a Quaternion<S>> for &'b Quaternion<S>
impl<'a, 'b, S: BaseFloat> Add<&'a Quaternion<S>> for &'b Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
+
operator.source§fn add(self, other: &'a Quaternion<S>) -> Quaternion<S>
fn add(self, other: &'a Quaternion<S>) -> Quaternion<S>
+
operation. Read moresource§impl<'a, S: BaseFloat> Add<&'a Quaternion<S>> for Quaternion<S>
impl<'a, S: BaseFloat> Add<&'a Quaternion<S>> for Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
+
operator.source§fn add(self, other: &'a Quaternion<S>) -> Quaternion<S>
fn add(self, other: &'a Quaternion<S>) -> Quaternion<S>
+
operation. Read moresource§impl<'a, S: BaseFloat> Add<Quaternion<S>> for &'a Quaternion<S>
impl<'a, S: BaseFloat> Add<Quaternion<S>> for &'a Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
+
operator.source§fn add(self, other: Quaternion<S>) -> Quaternion<S>
fn add(self, other: Quaternion<S>) -> Quaternion<S>
+
operation. Read moresource§impl<S: BaseFloat> Add<Quaternion<S>> for Quaternion<S>
impl<S: BaseFloat> Add<Quaternion<S>> for Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
+
operator.source§fn add(self, other: Quaternion<S>) -> Quaternion<S>
fn add(self, other: Quaternion<S>) -> Quaternion<S>
+
operation. Read moresource§impl<S: BaseFloat + AddAssign<S>> AddAssign<Quaternion<S>> for Quaternion<S>
impl<S: BaseFloat + AddAssign<S>> AddAssign<Quaternion<S>> for Quaternion<S>
source§fn add_assign(&mut self, other: Quaternion<S>)
fn add_assign(&mut self, other: Quaternion<S>)
+=
operation. Read moresource§impl<S: BaseFloat> AsMut<(S, S, S, S)> for Quaternion<S>
impl<S: BaseFloat> AsMut<(S, S, S, S)> for Quaternion<S>
source§fn as_mut(&mut self) -> &mut (S, S, S, S)
fn as_mut(&mut self) -> &mut (S, S, S, S)
source§impl<S: BaseFloat> AsRef<(S, S, S, S)> for Quaternion<S>
impl<S: BaseFloat> AsRef<(S, S, S, S)> for Quaternion<S>
source§fn as_ref(&self) -> &(S, S, S, S)
fn as_ref(&self) -> &(S, S, S, S)
source§impl<S: Clone> Clone for Quaternion<S>
impl<S: Clone> Clone for Quaternion<S>
source§fn clone(&self) -> Quaternion<S>
fn clone(&self) -> Quaternion<S>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<S: Debug> Debug for Quaternion<S>
impl<S: Debug> Debug for Quaternion<S>
source§impl<'a> Div<&'a Quaternion<f32>> for f32
impl<'a> Div<&'a Quaternion<f32>> for f32
§type Output = Quaternion<f32>
type Output = Quaternion<f32>
/
operator.source§fn div(self, other: &'a Quaternion<f32>) -> Quaternion<f32>
fn div(self, other: &'a Quaternion<f32>) -> Quaternion<f32>
/
operation. Read moresource§impl<'a> Div<&'a Quaternion<f64>> for f64
impl<'a> Div<&'a Quaternion<f64>> for f64
§type Output = Quaternion<f64>
type Output = Quaternion<f64>
/
operator.source§fn div(self, other: &'a Quaternion<f64>) -> Quaternion<f64>
fn div(self, other: &'a Quaternion<f64>) -> Quaternion<f64>
/
operation. Read moresource§impl Div<Quaternion<f32>> for f32
impl Div<Quaternion<f32>> for f32
§type Output = Quaternion<f32>
type Output = Quaternion<f32>
/
operator.source§fn div(self, other: Quaternion<f32>) -> Quaternion<f32>
fn div(self, other: Quaternion<f32>) -> Quaternion<f32>
/
operation. Read moresource§impl Div<Quaternion<f64>> for f64
impl Div<Quaternion<f64>> for f64
§type Output = Quaternion<f64>
type Output = Quaternion<f64>
/
operator.source§fn div(self, other: Quaternion<f64>) -> Quaternion<f64>
fn div(self, other: Quaternion<f64>) -> Quaternion<f64>
/
operation. Read moresource§impl<'a, S: BaseFloat> Div<S> for &'a Quaternion<S>
impl<'a, S: BaseFloat> Div<S> for &'a Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
/
operator.source§fn div(self, other: S) -> Quaternion<S>
fn div(self, other: S) -> Quaternion<S>
/
operation. Read moresource§impl<S: BaseFloat> Div<S> for Quaternion<S>
impl<S: BaseFloat> Div<S> for Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
/
operator.source§fn div(self, other: S) -> Quaternion<S>
fn div(self, other: S) -> Quaternion<S>
/
operation. Read moresource§impl<S: BaseFloat + DivAssign<S>> DivAssign<S> for Quaternion<S>
impl<S: BaseFloat + DivAssign<S>> DivAssign<S> for Quaternion<S>
source§fn div_assign(&mut self, scalar: S)
fn div_assign(&mut self, scalar: S)
/=
operation. Read moresource§impl<'a, S: BaseFloat> From<&'a [S; 4]> for &'a Quaternion<S>
impl<'a, S: BaseFloat> From<&'a [S; 4]> for &'a Quaternion<S>
source§fn from(v: &'a [S; 4]) -> &'a Quaternion<S>
fn from(v: &'a [S; 4]) -> &'a Quaternion<S>
source§impl<'a, S: BaseFloat> From<&'a (S, S, S, S)> for &'a Quaternion<S>
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>
fn from(v: &'a (S, S, S, S)) -> &'a Quaternion<S>
source§impl<'a, S: BaseFloat> From<&'a mut [S; 4]> for &'a mut Quaternion<S>
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>
fn from(v: &'a mut [S; 4]) -> &'a mut Quaternion<S>
source§impl<'a, S: BaseFloat> From<&'a mut (S, S, S, S)> for &'a mut Quaternion<S>
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>
fn from(v: &'a mut (S, S, S, S)) -> &'a mut Quaternion<S>
source§impl<S: BaseFloat> From<[S; 4]> for Quaternion<S>
impl<S: BaseFloat> From<[S; 4]> for Quaternion<S>
source§fn from(v: [S; 4]) -> Quaternion<S>
fn from(v: [S; 4]) -> Quaternion<S>
source§impl<S: BaseFloat> From<(S, S, S, S)> for Quaternion<S>
impl<S: BaseFloat> From<(S, S, S, S)> for Quaternion<S>
source§fn from(v: (S, S, S, S)) -> Quaternion<S>
fn from(v: (S, S, S, S)) -> Quaternion<S>
source§impl<S: BaseFloat> From<Basis3<S>> for Quaternion<S>
impl<S: BaseFloat> From<Basis3<S>> for Quaternion<S>
source§fn from(b: Basis3<S>) -> Quaternion<S>
fn from(b: Basis3<S>) -> Quaternion<S>
source§impl<A> From<Euler<A>> for Quaternion<A::Unitless>where
A: Angle + Into<Rad<<A as Angle>::Unitless>>,
impl<A> From<Euler<A>> for Quaternion<A::Unitless>where A: Angle + Into<Rad<<A as Angle>::Unitless>>,
source§impl<S: BaseFloat> From<Matrix3<S>> for Quaternion<S>
impl<S: BaseFloat> From<Matrix3<S>> for Quaternion<S>
source§fn from(mat: Matrix3<S>) -> Quaternion<S>
fn from(mat: Matrix3<S>) -> Quaternion<S>
Convert the matrix to a quaternion
source§impl<S: BaseFloat> From<Quaternion<S>> for Basis3<S>
impl<S: BaseFloat> From<Quaternion<S>> for Basis3<S>
source§fn from(quat: Quaternion<S>) -> Basis3<S>
fn from(quat: Quaternion<S>) -> Basis3<S>
source§impl<S: BaseFloat> From<Quaternion<S>> for Matrix3<S>
impl<S: BaseFloat> From<Quaternion<S>> for Matrix3<S>
source§fn from(quat: Quaternion<S>) -> Matrix3<S>
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>
impl<S: BaseFloat> From<Quaternion<S>> for Matrix4<S>
source§fn from(quat: Quaternion<S>) -> Matrix4<S>
fn from(quat: Quaternion<S>) -> Matrix4<S>
Convert the quaternion to a 4 x 4 rotation matrix.
source§impl<S: BaseFloat> InnerSpace for Quaternion<S>
impl<S: BaseFloat> InnerSpace for Quaternion<S>
source§fn dot(self, other: Quaternion<S>) -> S
fn dot(self, other: Quaternion<S>) -> S
source§fn magnitude2(self) -> Self::Scalar
fn magnitude2(self) -> Self::Scalar
source§fn angle(self, other: Self) -> Rad<Self::Scalar>where
Self::Scalar: BaseFloat,
fn angle(self, other: Self) -> Rad<Self::Scalar>where Self::Scalar: BaseFloat,
source§fn project_on(self, other: Self) -> Self
fn project_on(self, other: Self) -> Self
source§impl<S: BaseFloat> Into<(S, S, S, S)> for Quaternion<S>
impl<S: BaseFloat> Into<(S, S, S, S)> for Quaternion<S>
source§fn into(self) -> (S, S, S, S)
fn into(self) -> (S, S, S, S)
source§impl<S: BaseFloat> MetricSpace for Quaternion<S>
impl<S: BaseFloat> MetricSpace for Quaternion<S>
source§impl<'a, 'b, S: BaseFloat> Mul<&'a Quaternion<S>> for &'b Quaternion<S>
impl<'a, 'b, S: BaseFloat> Mul<&'a Quaternion<S>> for &'b Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
*
operator.source§fn mul(self, other: &'a Quaternion<S>) -> Quaternion<S>
fn mul(self, other: &'a Quaternion<S>) -> Quaternion<S>
*
operation. Read moresource§impl<'a, S: BaseFloat> Mul<&'a Quaternion<S>> for Quaternion<S>
impl<'a, S: BaseFloat> Mul<&'a Quaternion<S>> for Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
*
operator.source§fn mul(self, other: &'a Quaternion<S>) -> Quaternion<S>
fn mul(self, other: &'a Quaternion<S>) -> Quaternion<S>
*
operation. Read moresource§impl<'a> Mul<&'a Quaternion<f32>> for f32
impl<'a> Mul<&'a Quaternion<f32>> for f32
§type Output = Quaternion<f32>
type Output = Quaternion<f32>
*
operator.source§fn mul(self, other: &'a Quaternion<f32>) -> Quaternion<f32>
fn mul(self, other: &'a Quaternion<f32>) -> Quaternion<f32>
*
operation. Read moresource§impl<'a> Mul<&'a Quaternion<f64>> for f64
impl<'a> Mul<&'a Quaternion<f64>> for f64
§type Output = Quaternion<f64>
type Output = Quaternion<f64>
*
operator.source§fn mul(self, other: &'a Quaternion<f64>) -> Quaternion<f64>
fn mul(self, other: &'a Quaternion<f64>) -> Quaternion<f64>
*
operation. Read moresource§impl<'a, S: BaseFloat> Mul<Quaternion<S>> for &'a Quaternion<S>
impl<'a, S: BaseFloat> Mul<Quaternion<S>> for &'a Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
*
operator.source§fn mul(self, other: Quaternion<S>) -> Quaternion<S>
fn mul(self, other: Quaternion<S>) -> Quaternion<S>
*
operation. Read moresource§impl<S: BaseFloat> Mul<Quaternion<S>> for Quaternion<S>
impl<S: BaseFloat> Mul<Quaternion<S>> for Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
*
operator.source§fn mul(self, other: Quaternion<S>) -> Quaternion<S>
fn mul(self, other: Quaternion<S>) -> Quaternion<S>
*
operation. Read moresource§impl Mul<Quaternion<f32>> for f32
impl Mul<Quaternion<f32>> for f32
§type Output = Quaternion<f32>
type Output = Quaternion<f32>
*
operator.source§fn mul(self, other: Quaternion<f32>) -> Quaternion<f32>
fn mul(self, other: Quaternion<f32>) -> Quaternion<f32>
*
operation. Read moresource§impl Mul<Quaternion<f64>> for f64
impl Mul<Quaternion<f64>> for f64
§type Output = Quaternion<f64>
type Output = Quaternion<f64>
*
operator.source§fn mul(self, other: Quaternion<f64>) -> Quaternion<f64>
fn mul(self, other: Quaternion<f64>) -> Quaternion<f64>
*
operation. Read moresource§impl<'a, S: BaseFloat> Mul<S> for &'a Quaternion<S>
impl<'a, S: BaseFloat> Mul<S> for &'a Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
*
operator.source§fn mul(self, other: S) -> Quaternion<S>
fn mul(self, other: S) -> Quaternion<S>
*
operation. Read moresource§impl<S: BaseFloat> Mul<S> for Quaternion<S>
impl<S: BaseFloat> Mul<S> for Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
*
operator.source§fn mul(self, other: S) -> Quaternion<S>
fn mul(self, other: S) -> Quaternion<S>
*
operation. Read moresource§impl<S: BaseFloat + MulAssign<S>> MulAssign<S> for Quaternion<S>
impl<S: BaseFloat + MulAssign<S>> MulAssign<S> for Quaternion<S>
source§fn mul_assign(&mut self, scalar: S)
fn mul_assign(&mut self, scalar: S)
*=
operation. Read moresource§impl<'a, S: BaseFloat> Neg for &'a Quaternion<S>
impl<'a, S: BaseFloat> Neg for &'a Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
-
operator.source§fn neg(self) -> Quaternion<S>
fn neg(self) -> Quaternion<S>
-
operation. Read moresource§impl<S: BaseFloat> Neg for Quaternion<S>
impl<S: BaseFloat> Neg for Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
-
operator.source§fn neg(self) -> Quaternion<S>
fn neg(self) -> Quaternion<S>
-
operation. Read moresource§impl<S: BaseFloat> One for Quaternion<S>
impl<S: BaseFloat> One for Quaternion<S>
source§fn one() -> Quaternion<S>
fn one() -> Quaternion<S>
source§impl<S: PartialEq> PartialEq<Quaternion<S>> for Quaternion<S>
impl<S: PartialEq> PartialEq<Quaternion<S>> for Quaternion<S>
source§fn eq(&self, other: &Quaternion<S>) -> bool
fn eq(&self, other: &Quaternion<S>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'a, S: 'a + BaseFloat> Product<&'a Quaternion<S>> for Quaternion<S>
impl<'a, S: 'a + BaseFloat> Product<&'a Quaternion<S>> for Quaternion<S>
source§fn product<I: Iterator<Item = &'a Quaternion<S>>>(iter: I) -> Quaternion<S>
fn product<I: Iterator<Item = &'a Quaternion<S>>>(iter: I) -> Quaternion<S>
Self
from the elements by
multiplying the items.source§impl<S: BaseFloat> Product<Quaternion<S>> for Quaternion<S>
impl<S: BaseFloat> Product<Quaternion<S>> for Quaternion<S>
source§fn product<I: Iterator<Item = Quaternion<S>>>(iter: I) -> Quaternion<S>
fn product<I: Iterator<Item = Quaternion<S>>>(iter: I) -> Quaternion<S>
Self
from the elements by
multiplying the items.source§impl<S: BaseFloat> RelativeEq<Quaternion<S>> for Quaternion<S>
impl<S: BaseFloat> RelativeEq<Quaternion<S>> for Quaternion<S>
source§fn default_max_relative() -> S::Epsilon
fn default_max_relative() -> S::Epsilon
source§fn relative_eq(
&self,
other: &Self,
epsilon: S::Epsilon,
max_relative: S::Epsilon
) -> bool
fn relative_eq( &self, other: &Self, epsilon: S::Epsilon, max_relative: S::Epsilon ) -> bool
source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool
RelativeEq::relative_eq
.source§impl<'a, S: BaseFloat> Rem<S> for &'a Quaternion<S>
impl<'a, S: BaseFloat> Rem<S> for &'a Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
%
operator.source§fn rem(self, other: S) -> Quaternion<S>
fn rem(self, other: S) -> Quaternion<S>
%
operation. Read moresource§impl<S: BaseFloat> Rem<S> for Quaternion<S>
impl<S: BaseFloat> Rem<S> for Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
%
operator.source§fn rem(self, other: S) -> Quaternion<S>
fn rem(self, other: S) -> Quaternion<S>
%
operation. Read moresource§impl<S: BaseFloat + RemAssign<S>> RemAssign<S> for Quaternion<S>
impl<S: BaseFloat + RemAssign<S>> RemAssign<S> for Quaternion<S>
source§fn rem_assign(&mut self, scalar: S)
fn rem_assign(&mut self, scalar: S)
%=
operation. Read moresource§impl<S: BaseFloat> Rotation for Quaternion<S>
impl<S: BaseFloat> Rotation for Quaternion<S>
source§fn rotate_vector(&self, vec: Vector3<S>) -> Vector3<S>
fn rotate_vector(&self, vec: Vector3<S>) -> Vector3<S>
Evaluate the conjugation of vec
by self
.
Note that self
should be a unit quaternion (i.e. normalized) to represent a 3D rotation.
type Space = Point3<S>
source§fn look_at(dir: Vector3<S>, up: Vector3<S>) -> Quaternion<S>
fn look_at(dir: Vector3<S>, up: Vector3<S>) -> Quaternion<S>
source§fn between_vectors(a: Vector3<S>, b: Vector3<S>) -> Quaternion<S>
fn between_vectors(a: Vector3<S>, b: Vector3<S>) -> Quaternion<S>
source§fn invert(&self) -> Quaternion<S>
fn invert(&self) -> Quaternion<S>
r * r.invert()
is the identity.source§fn rotate_point(&self, point: Self::Space) -> Self::Space
fn rotate_point(&self, point: Self::Space) -> Self::Space
source§impl<S: BaseFloat> Rotation3 for Quaternion<S>
impl<S: BaseFloat> Rotation3 for Quaternion<S>
type Scalar = S
source§fn from_axis_angle<A: Into<Rad<S>>>(axis: Vector3<S>, angle: A) -> Quaternion<S>
fn from_axis_angle<A: Into<Rad<S>>>(axis: Vector3<S>, angle: A) -> Quaternion<S>
source§fn from_angle_x<A: Into<Rad<Self::Scalar>>>(theta: A) -> Self
fn from_angle_x<A: Into<Rad<Self::Scalar>>>(theta: A) -> Self
x
axis (pitch).source§impl<'a, 'b, S: BaseFloat> Sub<&'a Quaternion<S>> for &'b Quaternion<S>
impl<'a, 'b, S: BaseFloat> Sub<&'a Quaternion<S>> for &'b Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
-
operator.source§fn sub(self, other: &'a Quaternion<S>) -> Quaternion<S>
fn sub(self, other: &'a Quaternion<S>) -> Quaternion<S>
-
operation. Read moresource§impl<'a, S: BaseFloat> Sub<&'a Quaternion<S>> for Quaternion<S>
impl<'a, S: BaseFloat> Sub<&'a Quaternion<S>> for Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
-
operator.source§fn sub(self, other: &'a Quaternion<S>) -> Quaternion<S>
fn sub(self, other: &'a Quaternion<S>) -> Quaternion<S>
-
operation. Read moresource§impl<'a, S: BaseFloat> Sub<Quaternion<S>> for &'a Quaternion<S>
impl<'a, S: BaseFloat> Sub<Quaternion<S>> for &'a Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
-
operator.source§fn sub(self, other: Quaternion<S>) -> Quaternion<S>
fn sub(self, other: Quaternion<S>) -> Quaternion<S>
-
operation. Read moresource§impl<S: BaseFloat> Sub<Quaternion<S>> for Quaternion<S>
impl<S: BaseFloat> Sub<Quaternion<S>> for Quaternion<S>
§type Output = Quaternion<S>
type Output = Quaternion<S>
-
operator.source§fn sub(self, other: Quaternion<S>) -> Quaternion<S>
fn sub(self, other: Quaternion<S>) -> Quaternion<S>
-
operation. Read moresource§impl<S: BaseFloat + SubAssign<S>> SubAssign<Quaternion<S>> for Quaternion<S>
impl<S: BaseFloat + SubAssign<S>> SubAssign<Quaternion<S>> for Quaternion<S>
source§fn sub_assign(&mut self, other: Quaternion<S>)
fn sub_assign(&mut self, other: Quaternion<S>)
-=
operation. Read moresource§impl<'a, S: 'a + BaseFloat> Sum<&'a Quaternion<S>> for Quaternion<S>
impl<'a, S: 'a + BaseFloat> Sum<&'a Quaternion<S>> for Quaternion<S>
source§fn sum<I: Iterator<Item = &'a Quaternion<S>>>(iter: I) -> Quaternion<S>
fn sum<I: Iterator<Item = &'a Quaternion<S>>>(iter: I) -> Quaternion<S>
Self
from the elements by
“summing up” the items.source§impl<S: BaseFloat> Sum<Quaternion<S>> for Quaternion<S>
impl<S: BaseFloat> Sum<Quaternion<S>> for Quaternion<S>
source§fn sum<I: Iterator<Item = Quaternion<S>>>(iter: I) -> Quaternion<S>
fn sum<I: Iterator<Item = Quaternion<S>>>(iter: I) -> Quaternion<S>
Self
from the elements by
“summing up” the items.