From f0f1781b5b8189f34f80420aeb79ebc76d80feb3 Mon Sep 17 00:00:00 2001 From: andrea Date: Tue, 31 Oct 2023 19:12:41 +0100 Subject: [PATCH] fixed a sign in ccw_rotation + readability --- source/point.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/point.h b/source/point.h index d29062c..434fd9d 100644 --- a/source/point.h +++ b/source/point.h @@ -50,4 +50,6 @@ struct Point { // clockwise rotation: use -theta, center = c Point ccw_rotation(ld theta, const Point p, const Point c = Point(0, 0)){ ld rad = deg_to_rad(theta); - return Point(cosl(rad) * (p.x - c.x) - sinl(rad) * (p.y - c.y) + c.x, sinl(rad) * (p.x - c.x) - cosl(rad) * (p.y - c.y) + c.y); } \ No newline at end of file + return Point( + cosl(rad) * (p.x - c.x) - sinl(rad) * (p.y - c.y) + c.x, + sinl(rad) * (p.x - c.x) + cosl(rad) * (p.y - c.y) + c.y); } \ No newline at end of file