write m*v test

This commit is contained in:
Quaternions 2024-09-09 17:32:39 -07:00
parent b772647137
commit 57c3f2dd9e

View File

@ -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(){