Add rotation wrt center of a matrix.

This commit is contained in:
Sébastien Crozet 2013-06-29 18:59:04 +00:00
parent 50293ca417
commit f8515f4683
1 changed files with 14 additions and 0 deletions

View File

@ -48,3 +48,17 @@ pub fn rotate_wrt_point<M: Translatable<LV, M2>,
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<M: Translatable<LV, M2> + Translation<LV>,
M2: Rotation<AV> + Translation<LV>,
LV: Neg<LV>,
AV>
(m: &M, ammount: &AV) -> M2
{ rotate_wrt_point(m, ammount, &m.translation()) }