Skip to content

Inconsistency in math.py #2770

@Tejtex

Description

@Tejtex

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions