From 921422a1892cea2056b6122146b8498c67b4b9bd Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Thu, 8 Aug 2024 01:48:39 +0200 Subject: [PATCH] Fix Vec2.angle --- lib/std/math/math_vector.c3 | 4 ++-- releasenotes.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/std/math/math_vector.c3 b/lib/std/math/math_vector.c3 index 5b8917fad..9ccfab26c 100644 --- a/lib/std/math/math_vector.c3 +++ b/lib/std/math/math_vector.c3 @@ -25,11 +25,11 @@ macro Vec4.distance_sq(self, Vec4 v2) => (self - v2).length_sq(); macro Vec2f.transform(self, Matrix4f mat) => transform2(self, mat); macro Vec2f.rotate(self, float angle) => rotate(self, angle); -macro Vec2f.angle(self, Vec2f v2) => math::atan2(v2[1], v2[0]) - math::atan2(self[1], v2[0]); +macro Vec2f.angle(self, Vec2f v2) => math::atan2(v2.y, v2.x) - math::atan2(self.y, self.x); macro Vec2.transform(self, Matrix4 mat) => transform2(self, mat); macro Vec2.rotate(self, double angle) => rotate(self, angle); -macro Vec2.angle(self, Vec2 v2) => math::atan2(v2[1], v2[0]) - math::atan2(self[1], v2[0]); +macro Vec2.angle(self, Vec2 v2) => math::atan2(v2.y, v2.x) - math::atan2(self.y, self.x); macro Vec2f.clamp_mag(self, float min, float max) => clamp_magnitude(self, min, max); macro Vec3f.clamp_mag(self, float min, float max) => clamp_magnitude(self, min, max); diff --git a/releasenotes.md b/releasenotes.md index d412ce24d..3a323cb4c 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -55,6 +55,7 @@ - `send` and `recv` added to `libc` for Posix / Win32. - Add support to destroy temp allocators. +- Fix Vec2.angle ## 0.6.1 Change list