From f8515f468330ad3f924e10b086da2e0147e29016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sat, 29 Jun 2013 18:59:04 +0000 Subject: [PATCH] Add rotation wrt center of a matrix. --- src/traits/rotation.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/traits/rotation.rs b/src/traits/rotation.rs index c4a7c69a..1aa548e7 100644 --- a/src/traits/rotation.rs +++ b/src/traits/rotation.rs @@ -48,3 +48,17 @@ pub fn rotate_wrt_point, res } + +/** + * Applies a rotation centered on the input translation. + * + * - `m`: the object to be rotated. + * - `ammount`: the rotation to apply. + */ +#[inline] +pub fn rotate_wrt_center + Translation, + M2: Rotation + Translation, + LV: Neg, + AV> + (m: &M, ammount: &AV) -> M2 +{ rotate_wrt_point(m, ammount, &m.translation()) }