From 57c3f2dd9e9ce9a4dcc76f4b7550a485c39ba7ff Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 9 Sep 2024 17:32:39 -0700 Subject: [PATCH] write m*v test --- fixed_wide_vectors/src/tests/tests.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/fixed_wide_vectors/src/tests/tests.rs b/fixed_wide_vectors/src/tests/tests.rs index 04a5d55..41233b2 100644 --- a/fixed_wide_vectors/src/tests/tests.rs +++ b/fixed_wide_vectors/src/tests/tests.rs @@ -1,4 +1,4 @@ -use crate::types::{Vector3,Matrix4x3,Matrix2x4,Matrix2x3}; +use crate::types::{Vector2,Vector3,Matrix4x3,Matrix2x4,Matrix2x3,Matrix3x2}; #[test] fn test_bool(){ @@ -19,6 +19,17 @@ fn test_arithmetic(){ assert_eq!((a+a*2).array,Vector3::new([1*3,2*3,3*3]).array); } +#[test] +fn matrix_transform_vector(){ + let m=Matrix3x2::new([ + [1,2,3], + [4,5,6], + ]); + let v=Vector3::new([1,2,3]); + let transformed=m*v; + assert_eq!(transformed.array,Vector2::new([14,32]).array); +} + #[test] fn matrix_dot(){