arcade icon indicating copy to clipboard operation
arcade copied to clipboard

Inconsistency in math.py

Open Tejtex opened this issue 3 months ago • 0 comments

I've noticed that in math.py there’s an inconsistency in how points are handled:

  • Some functions, like rotate_point and get_distance, take x and y as separate parameters:
def get_distance(x1: float, y1: float, x2: float, y2: float) -> float
def rotate_point(x: float, y: float, cx: float, cy: float, angle_degrees: float)
  • Others, like rand_on_line, use Point2:
def rand_on_line(pos1: Point2, pos2: Point2) -> Point

This can be confusing for users of the library and makes it harder to work consistently with points. It might be better to standardize all math functions to use Point2 object.

Tejtex avatar Sep 15 '25 08:09 Tejtex