Add a test for the 2d rotation.
This commit is contained in:
parent
dc0757b2e5
commit
52a769a431
@ -1,5 +1,5 @@
|
||||
#[test]
|
||||
use core::num::{One};
|
||||
use core::num::{One, abs};
|
||||
#[test]
|
||||
use core::rand::{random};
|
||||
#[test]
|
||||
@ -9,11 +9,17 @@ use std::cmp::FuzzyEq;
|
||||
#[test]
|
||||
use traits::inv::Inv;
|
||||
#[test]
|
||||
use traits::rotation::Rotation;
|
||||
#[test]
|
||||
use dim1::vec1::vec1;
|
||||
#[test]
|
||||
use dim1::mat1::Mat1;
|
||||
#[test]
|
||||
use dim2::mat2::Mat2;
|
||||
#[test]
|
||||
use dim3::mat3::Mat3;
|
||||
#[test]
|
||||
use adaptors::rotmat::Rotmat;
|
||||
// #[test]
|
||||
// use traits::dim::d7;
|
||||
|
||||
@ -60,6 +66,13 @@ fn test_inv_mat3()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rot2()
|
||||
fn test_rotation2()
|
||||
{
|
||||
for uint::range(0u, 10000u) |_|
|
||||
{
|
||||
let randmat = One::one::<Rotmat<Mat2<f64>>>();
|
||||
let ang = &vec1(abs::<f64>(random()) % f64::consts::pi);
|
||||
|
||||
assert!(randmat.rotated(ang).rotation().fuzzy_eq(ang));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user