use crate::{Vector2,Vector3,Vector4}; pub struct Matrix2 { pub x_axis: T, pub y_axis: T, } pub struct Matrix3 { pub x_axis: T, pub y_axis: T, pub z_axis: T, } pub struct Matrix4 { pub x_axis: T, pub y_axis: T, pub z_axis: T, pub w_axis: T, } crate::impl_extend!(Matrix2 { x_axis, y_axis }, Matrix3, z_axis); crate::impl_extend!(Matrix3 { x_axis, y_axis, z_axis }, Matrix4, w_axis); //TODO: extend vertically crate::impl_matrices!( //outer struct and equivalent vector ( (Matrix2 { x_axis, y_axis }, Vector2 { x, y }, 2), (Matrix3 { x_axis, y_axis, z_axis }, Vector3 { x, y, z }, 3), (Matrix4 { x_axis, y_axis, z_axis, w_axis }, Vector4 { x, y, z, w }, 4) ), //inner struct and equivalent matrix ( (Vector2 { x, y }, Matrix2 { x_axis, y_axis }, 2), (Vector3 { x, y, z }, Matrix3 { x_axis, y_axis, z_axis }, 3), (Vector4 { x, y, z, w }, Matrix4 { x_axis, y_axis, z_axis, w_axis }, 4) ) );