Add quaternion dot product.

This commit is contained in:
sebcrozet 2018-09-22 15:39:21 +02:00 committed by Sébastien Crozet
parent 832bf42b56
commit 7884f20ea7
1 changed files with 6 additions and 0 deletions

View File

@ -202,6 +202,12 @@ impl<N: Real> Quaternion<N> {
self.coords.norm_squared()
}
/// The dot product of two quaternions.
#[inline]
pub fn dot(&self, rhs: &Self) -> N {
self.coords.dot(&rhs.coords)
}
/// The polar decomposition of this quaternion.
///
/// Returns, from left to right: the quaternion norm, the half rotation angle, the rotation