Represents a 2D point with x and y coordinates.
| 23 | |
| 24 | |
| 25 | class Point: |
| 26 | """Represents a 2D point with x and y coordinates.""" |
| 27 | |
| 28 | def __init__(self, x_coordinate: float, y_coordinate: float) -> None: |
| 29 | self.x = x_coordinate |
| 30 | self.y = y_coordinate |
| 31 | |
| 32 | def __eq__(self, other: object) -> bool: |
| 33 | if not isinstance(other, Point): |
| 34 | return NotImplemented |
| 35 | return self.x == other.x and self.y == other.y |
| 36 | |
| 37 | def __repr__(self) -> str: |
| 38 | return f"Point({self.x}, {self.y})" |
| 39 | |
| 40 | def __hash__(self) -> int: |
| 41 | return hash((self.x, self.y)) |
| 42 | |
| 43 | |
| 44 | def _cross_product(origin: Point, point_a: Point, point_b: Point) -> float: |
no outgoing calls