use na::{Real, U2, U3, UnitComplex}; use traits::Number; use aliases::{Mat, Vec}; /// Builds a 2D rotation matrix from an angle and right-multiply it to `m`. pub fn rotate2d(m: &Mat, angle: N) -> Mat { m * UnitComplex::new(angle).to_homogeneous() } /// Builds a 2D scaling matrix and right-multiply it to `m`. pub fn scale2d(m: &Mat, v: &Vec) -> Mat { m.prepend_nonuniform_scaling(v) } /// Builds a translation matrix and right-multiply it to `m`. pub fn translate2d(m: &Mat, v: &Vec) -> Mat { m.prepend_translation(v) }