forked from M-Labs/nalgebra
Add a test for the 2d rotation.
This commit is contained in:
parent
dc0757b2e5
commit
52a769a431
@ -1,5 +1,5 @@
|
|||||||
#[test]
|
#[test]
|
||||||
use core::num::{One};
|
use core::num::{One, abs};
|
||||||
#[test]
|
#[test]
|
||||||
use core::rand::{random};
|
use core::rand::{random};
|
||||||
#[test]
|
#[test]
|
||||||
@ -9,11 +9,17 @@ use std::cmp::FuzzyEq;
|
|||||||
#[test]
|
#[test]
|
||||||
use traits::inv::Inv;
|
use traits::inv::Inv;
|
||||||
#[test]
|
#[test]
|
||||||
|
use traits::rotation::Rotation;
|
||||||
|
#[test]
|
||||||
|
use dim1::vec1::vec1;
|
||||||
|
#[test]
|
||||||
use dim1::mat1::Mat1;
|
use dim1::mat1::Mat1;
|
||||||
#[test]
|
#[test]
|
||||||
use dim2::mat2::Mat2;
|
use dim2::mat2::Mat2;
|
||||||
#[test]
|
#[test]
|
||||||
use dim3::mat3::Mat3;
|
use dim3::mat3::Mat3;
|
||||||
|
#[test]
|
||||||
|
use adaptors::rotmat::Rotmat;
|
||||||
// #[test]
|
// #[test]
|
||||||
// use traits::dim::d7;
|
// use traits::dim::d7;
|
||||||
|
|
||||||
@ -60,6 +66,13 @@ fn test_inv_mat3()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[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