Represents a point with floating-point coordinates in 2D space.
More...
|
| | __init__ (self, float x, float y) |
| | Initializes a new instance of the PointF class.
|
| |
| Iterator[float] | __iter__ (self) |
| | Returns an iterator over the coordinates of the point.
|
| |
| int | __len__ (self) |
| | Returns the number of coordinates in the point.
|
| |
| float | __getitem__ (self, int index) |
| | Returns the coordinate at the specified index.
|
| |
|
|
| x = x |
| | The x-coordinate of the point.
|
| |
|
| y = y |
| | The y-coordinate of the point.
|
| |
Represents a point with floating-point coordinates in 2D space.
◆ __init__()
| __init__ |
( |
| self, |
|
|
float | x, |
|
|
float | y ) |
Initializes a new instance of the PointF class.
- Parameters
-
| x | The x-coordinate of the point. |
| y | The y-coordinate of the point. |
◆ __getitem__()
| float __getitem__ |
( |
| self, |
|
|
int | index ) |
Returns the coordinate at the specified index.
- Parameters
-
| index | The index of the coordinate (0 for x, 1 for y). |
- Returns
- : The coordinate at the specified index. @raise IndexError: If the index is out of range.
◆ __iter__()
| Iterator[float] __iter__ |
( |
| self | ) |
|
Returns an iterator over the coordinates of the point.
- Returns
- : An iterator over the x and y coordinates.
◆ __len__()
Returns the number of coordinates in the point.
- Returns
- : The number of coordinates (always 2 for a 2D point).
The documentation for this class was generated from the following file: