SlottedPoint
A 2D point using slots for memory efficiency.
Usage
SlottedPoint()Parameters
x: float-
X coordinate.
y: float-
Y coordinate.
label: str = ""-
Optional label for the point.
Methods
| Name | Description |
|---|---|
| __repr__() | Return string representation. |
| as_tuple() | Return coordinates as tuple. |
| distance_to() | Calculate distance to another point. |
| translate() | Return a new point translated by (dx, dy). |
__repr__()
Return string representation.
Usage
__repr__()as_tuple()
Return coordinates as tuple.
Usage
as_tuple()Returns
tuple-
(x, y) tuple.
distance_to()
Calculate distance to another point.
Usage
distance_to(other)Parameters
other: SlottedPoint-
The other point.
Returns
float-
Euclidean distance.
translate()
Return a new point translated by (dx, dy).
Usage
translate(dx, dy)Parameters
dx: float-
X offset.
dy: float-
Y offset.
Returns
SlottedPoint-
New translated point.