1
0
forked from josh/j3ml

Implement Transform2D.h

This commit is contained in:
2024-01-23 04:14:24 -05:00
parent fd2289cee3
commit f7a7ec38d7
5 changed files with 132 additions and 12 deletions

View File

@@ -60,16 +60,14 @@ namespace LinearAlgebra {
Quaternion::Quaternion(float X, float Y, float Z, float W) : Vector4(X,Y,Z,W) {}
// TODO: implement
float Quaternion::Dot(const Quaternion &quaternion) const {}
float Quaternion::Dot(const Quaternion &rhs) const {
return x * rhs.x + y * rhs.y + z * rhs.z + w * rhs.w;
}
Quaternion::Quaternion(Vector4 vector4) {
}
float Quaternion::Angle() const {
return std::acos(w) * 2.f;
}
Quaternion Quaternion::Normalize() const {
float length = Length();
if (length < 1e-4f)