#![allow(bad_style)] #![allow(clippy::float_cmp)] use hektor::*; #[test] fn Mat2_determinant() { assert_eq!(Mat2::default().determinant(), 0.0); // let m = Mat2::from([4.0, 3.0, 6.0, 8.0]); assert_eq!(m.determinant(), 14.0); #[cfg(feature = "free_functions")] assert_eq!(determinant(m), 14.0); } #[test] fn Mat3_determinant() { assert_eq!(Mat3::default().determinant(), 0.0); // let m = Mat3::from([6.0, 4.0, 2.0, 1.0, -2.0, 8.0, 1.0, 5.0, 7.0]); assert_eq!(m.determinant(), -306.0); #[cfg(feature = "free_functions")] assert_eq!(determinant(m), -306.0); } #[test] fn Mat4_determinant() { assert_eq!(Mat4::default().determinant(), 0.0); // let m = Mat4::from([ 1.0, 2.0, 3.0, 4.0, -1.0, 10.0, 6.0, 5.0, 20.0, 12.0, -8.0, -2.0, 4.0, -5.0, 2.0, 3.0, ]); assert_eq!(m.determinant(), 1650.0); #[cfg(feature = "free_functions")] assert_eq!(determinant(m), 1650.0); }