Function glm::builtin::distance [] [src]

pub fn distance<S: BaseFloat, T: GenFloatVec<S>>(p0: T, p1: T) -> S

Returns the distance between p0 and p1, i.e., length(p0 – p1).

Example

use glm::{ distance, vec2 };

let v1 = vec2(1., 2.);
let v2 = vec2(4., 6.);
assert_eq!(distance(v1, v2), 5.);