nalgebra_glm/gtx/
normalize_dot.rs

1use crate::RealNumber;
2
3use crate::aliases::TVec;
4
5/// The dot product of the normalized version of `x` and `y`.
6///
7/// This is currently the same as [`normalize_dot()`]
8///
9/// # See also:
10///
11/// * [`normalize_dot()`]
12pub fn fast_normalize_dot<T: RealNumber, const D: usize>(x: &TVec<T, D>, y: &TVec<T, D>) -> T {
13    // XXX: improve those.
14    x.normalize().dot(&y.normalize())
15}
16
17/// The dot product of the normalized version of `x` and `y`.
18///
19/// # See also:
20///
21/// * [`fast_normalize_dot()`]
22pub fn normalize_dot<T: RealNumber, const D: usize>(x: &TVec<T, D>, y: &TVec<T, D>) -> T {
23    // XXX: improve those.
24    x.normalize().dot(&y.normalize())
25}