use na::{Real, U2, U3, UnitComplex, Matrix3}; use traits::Number; use aliases::{Mat, Vec}; pub fn rotate(m: &Mat, angle: N) -> Mat { m * UnitComplex::new(angle).to_homogeneous() } pub fn scale(m: &Mat, v: &Vec) -> Mat { m.prepend_nonuniform_scaling(v) } pub fn shearX(m: &Mat, y: N) -> Mat { let _0 = N::zero(); let _1 = N::one(); let shear = Matrix3::new( _1, y, _0, _0, _1, _0, _0, _0, _1 ); m * shear } pub fn shearY(m: &Mat, x: N) -> Mat { let _0 = N::zero(); let _1 = N::one(); let shear = Matrix3::new( _1, _0, _0, x, _1, _0, _0, _0, _1 ); m * shear } pub fn translate(m: &Mat, v: &Vec) -> Mat { m.prepend_translation(v) }