dodal.common.Rectangle2D#
- class dodal.common.Rectangle2D[source]#
A 2D rectangle defined by two opposite corners.
This class represents a rectangle in 2D space using two points: (x1, y1) and (x2, y2). It provides methods to query rectangle properties and check point containment.
- Parameters:
Methods
contains(x, y)Check if a point is contained within the rectangle.
Get the maximum x-coordinate of the rectangle.
Get the maximum y-coordinate of the rectangle.
Get the minimum x-coordinate of the rectangle.
Get the minimum y-coordinate of the rectangle.
- get_max_x() float[source]#
Get the maximum x-coordinate of the rectangle.
- Returns:
The larger of the two x-coordinates (x1, x2).
- Return type:
- get_min_x() float[source]#
Get the minimum x-coordinate of the rectangle.
- Returns:
The smaller of the two x-coordinates (x1, x2).
- Return type:
- get_max_y() float[source]#
Get the maximum y-coordinate of the rectangle.
- Returns:
The larger of the two y-coordinates (y1, y2).
- Return type: