arcade icon indicating copy to clipboard operation
arcade copied to clipboard

Bug: rotate_around_point function in math.py returns incorrect results due to wrong translation

Open Raahi-18 opened this issue 5 months ago • 0 comments

The rotate_around_point function in math.py has a bug on line 394 where it adds the rotated displacement vector to the target point instead of the source point (rotation center).

The current code is the following: return target[0] + dx, target[1] + dy

Example of the bug: Rotating point (5, 0) around (3, 0) by 90° currently returns (5, 2) but should return (3, 2).

This is a simple one line fix just have to update return statement to: return source[0] + dx, source[1] + dy

I can make a PR for the update.

Raahi-18 avatar Jul 17 '25 17:07 Raahi-18