nalgebra/nalgebra-glm/src/gtx_normalize_dot.rs

17 lines
465 B
Rust
Raw Normal View History

2018-09-21 01:54:12 +08:00
use na::{Real, DefaultAllocator};
use traits::{Dimension, Alloc};
use aliases::Vec;
pub fn fastNormalizeDot<N: Real, D: Dimension>(x: &Vec<N, D>, y: &Vec<N, D>) -> N
where DefaultAllocator: Alloc<N, D> {
// XXX: improve those.
x.normalize().dot(&y.normalize())
}
pub fn normalizeDot<N: Real, D: Dimension>(x: &Vec<N, D>, y: &Vec<N, D>) -> N
where DefaultAllocator: Alloc<N, D> {
// XXX: improve those.
x.normalize().dot(&y.normalize())
}