Add TMatrix2.

This commit is contained in:
THoehne 2024-08-15 14:09:38 +02:00
parent 2bbeff1e23
commit f137d6ba8a
2 changed files with 63 additions and 54 deletions

View File

@ -86,6 +86,11 @@ namespace Phanes::Core::Math {
typedef TVector4<double, SIMD::use_simd<double, 4, true>::value> Vector4Regd;
typedef TVector4<double, SIMD::use_simd<double, 4, true>::value> Vector4Regf64;
// Matrix2
typedef TMatrix2<float> Matrix2;
typedef TMatrix2<float> Matrix2f;
typedef TMatrix2<double> Matrix2d;
} // Phanes::Core::Math::coretypes

View File

@ -98,7 +98,11 @@ namespace Phanes::Core::Math {
return "(" + ToString(v.x) + ", " + ToString(v.y) + ", " + ToString(v.z) + ", " + ToString(v.w) + ")";
}
//std::string toString(const Vector4& v);
template<RealType T>
std::string ToString(const TMatrix2<T>& m)
{
return "([" + ToString(m(0, 0)) + ", " + ToString(m(0, 1)) + "], [" + ToString(m(1, 0)) + ", " + ToString(m(1, 1)) + "])";
}
//std::string toString(const Matrix3& v);