Scanbot SDK
Loading...
Searching...
No Matches
Point

Represents a point with integer coordinates in 2D space. More...

Public Member Functions

 __init__ (self, int x, int y)
 Initializes a new instance of the Point class.
 
Iterator[int] __iter__ (self)
 Returns an iterator over the coordinates of the point.
 
int __len__ (self)
 Returns the number of coordinates in the point.
 
int __getitem__ (self, int index)
 Returns the coordinate at the specified index.
 

Public Attributes

 x = x
 The x-coordinate of the point.
 
 y = y
 The y-coordinate of the point.
 

Detailed Description

Represents a point with integer coordinates in 2D space.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
int x,
int y )

Initializes a new instance of the Point class.

Parameters
xThe x-coordinate of the point.
yThe y-coordinate of the point.

Member Function Documentation

◆ __getitem__()

int __getitem__ ( self,
int index )

Returns the coordinate at the specified index.

Parameters
indexThe 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[int] __iter__ ( self)

Returns an iterator over the coordinates of the point.

Returns
: An iterator over the x and y coordinates.

◆ __len__()

int __len__ ( self)

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: