Skip to content

Commit

Permalink
fixed a sign in ccw_rotation + readability
Browse files Browse the repository at this point in the history
  • Loading branch information
podd0 committed Oct 31, 2023
1 parent b0285be commit f0f1781
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/point.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,6 @@ struct Point {
// clockwise rotation: use -theta, center = c
Point<ld> ccw_rotation(ld theta, const Point<ld> p, const Point<ld> c = Point<ld>(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); }
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); }

0 comments on commit f0f1781

Please sign in to comment.