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::{Vector3, Rotation3};

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

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