diff --git a/src/lib.rs b/src/lib.rs index cf10096a..1920f498 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -350,10 +350,17 @@ pub fn one() -> T { /// Returns the trivial origin of an affine space. #[inline(always)] -pub fn orig() -> T { +pub fn orig() -> P { Orig::orig() } +/// Returns the center of two points. +#[inline] +pub fn center, V>(a: &P, b: &P) -> P { + let _2 = one::() + one(); + (*a + *b.as_vec()) / _2 +} + /* * FloatPnt */