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 crate::RealNumber;

use crate::aliases::Qua;

/// Multiplies two quaternions.
pub fn quat_cross<T: RealNumber>(q1: &Qua<T>, q2: &Qua<T>) -> Qua<T> {
    q1 * q2
}

/// The scalar product of two quaternions.
pub fn quat_dot<T: RealNumber>(x: &Qua<T>, y: &Qua<T>) -> T {
    x.dot(y)
}

/// The magnitude of the quaternion `q`.
pub fn quat_length<T: RealNumber>(q: &Qua<T>) -> T {
    q.norm()
}

/// The magnitude of the quaternion `q`.
pub fn quat_magnitude<T: RealNumber>(q: &Qua<T>) -> T {
    q.norm()
}

/// Normalizes the quaternion `q`.
pub fn quat_normalize<T: RealNumber>(q: &Qua<T>) -> Qua<T> {
    q.normalize()
}