Added a test for Quaternion::exp().

This commit is contained in:
Dimitri Sabadie 2016-07-29 18:02:37 +02:00
parent 988d9272d2
commit f9c1a2fd98

View File

@ -1,7 +1,7 @@
extern crate nalgebra as na;
extern crate rand;
use na::{Point3, Vector3, Rotation3, UnitQuaternion, Rotation};
use na::{Point3, Quaternion, Vector3, Rotation3, UnitQuaternion, Rotation, one};
use rand::random;
#[test]
@ -90,3 +90,9 @@ fn test_quaternion_angle_between() {
assert!(na::approx_eq(&na::norm(&na::rotation(&delta)), &delta_angle))
}
#[test]
fn test_quaternion_exp_zero_is_one() {
let q = Quaternion::new(0., 0., 0., 0.);
assert!(na::approx_eq(&q.exp(), &one()))
}