Function nalgebra::prepend_rotation [] [src]

pub fn prepend_rotation<V, M: Rotation<V>>(m: &M, v: &V) -> M

Pre-applies the rotation v to a copy of m.

extern crate nalgebra as na;
use na::{Vec3, Rot3};

fn main() {
    let t  = Rot3::new(Vec3::new(0.0f64, 0.0, 0.0));
    let v  = Vec3::new(1.0, 1.0, 1.0);
    let rt = na::prepend_rotation(&t, &v);

    assert!(na::approx_eq(&na::rotation(&rt), &Vec3::new(1.0, 1.0, 1.0)))
}