diff options
Diffstat (limited to 'core/math/math_2d.cpp')
| -rw-r--r-- | core/math/math_2d.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/math/math_2d.cpp b/core/math/math_2d.cpp index acaaa327f..3aaa539fb 100644 --- a/core/math/math_2d.cpp +++ b/core/math/math_2d.cpp @@ -74,6 +74,11 @@ float Vector2::distance_squared_to(const Vector2& p_vector2) const { float Vector2::angle_to(const Vector2& p_vector2) const { + return Math::atan2( tangent().dot(p_vector2), dot(p_vector2) ); +} + +float Vector2::angle_to_point(const Vector2& p_vector2) const { + return Math::atan2( x-p_vector2.x, y - p_vector2.y ); } @@ -594,6 +599,10 @@ Matrix32 Matrix32::rotated(float p_phi) const { } +float Matrix32::basis_determinant() const { + + return elements[0].x * elements[1].y - elements[0].y * elements[1].x; +} Matrix32 Matrix32::interpolate_with(const Matrix32& p_transform, float p_c) const { |
