#![allow(bad_style)] #![allow(clippy::float_cmp)] use hektor::*; #[test] fn Vec2_dot() { let a = Vec2::new(12.0, 16.0); let b = Vec2::new(-12.0, 9.0); assert_eq!(a.dot(b), 0.0); // let a = Vec2::new(-6.0, 8.0); let b = Vec2::new(5.0, 12.0); assert_eq!(a.dot(b), 66.0); } #[test] fn Vec3_dot() { let a = Vec3::new(9.0, 2.0, 7.0); let b = Vec3::new(4.0, 8.0, 10.0); assert_eq!(a.dot(b), 122.0); } #[test] fn Vec4_dot() { let a = Vec4::new(3.0, 5.0, -2.0, 1.0); let b = Vec4::new(1.0, 7.0, -6.0, 5.0); assert_eq!(a.dot(b), 55.0); }