1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
use na::Real;
use aliases::Qua;
/// Multiplies two quaternions.
pub fn quat_cross<N: Real>(q1: &Qua<N>, q2: &Qua<N>) -> Qua<N> {
q1 * q2
}
/// The scalar product of two quaternions.
pub fn quat_dot<N: Real>(x: &Qua<N>, y: &Qua<N>) -> N {
x.dot(y)
}
/// The magnitude of the quaternion `q`.
pub fn quat_length<N: Real>(q: &Qua<N>) -> N {
q.norm()
}
/// The magnitude of the quaternion `q`.
pub fn quat_magnitude<N: Real>(q: &Qua<N>) -> N {
q.norm()
}
/// Normalizes the quaternion `q`.
pub fn quat_normalize<N: Real>(q: &Qua<N>) -> Qua<N> {
q.normalize()
}