1
0
forked from josh/j3ml

Implementing Vector3 Unit Tests

This commit is contained in:
2024-01-02 21:31:44 -05:00
parent 09922ac0bd
commit 7429f0782f
5 changed files with 123 additions and 46 deletions

View File

@@ -5,6 +5,10 @@
namespace LinearAlgebra {
class Angle2D {
public:
float x;
float y;
bool operator==(const Angle2D& rhs) const {
return (this->x==rhs.x && this->y==rhs.y);
}
};
}

View File

@@ -3,6 +3,7 @@
#include <J3ML/LinearAlgebra/Vector3.h>
#include <cstddef>
#include <cstdlib>
#include <J3ML/LinearAlgebra/Angle2D.h>
namespace LinearAlgebra {
@@ -95,8 +96,8 @@ public:
static Vector3 Lerp(const Vector3& lhs, const Vector3& rhs, float alpha);
float AngleBetween(const Vector3& rhs) const; // TODO: 3D Angle representation?
static float AngleBetween(const Vector3& lhs, const Vector3& rhs); // TODO: 3D Angle representation?
Angle2D AngleBetween(const Vector3& rhs) const;
static Angle2D AngleBetween(const Vector3& lhs, const Vector3& rhs);
// Adds two vectors
Vector3 operator+(const Vector3& rhs) const;