GeometryBounds¶
- class GeometryBounds(center=None, size=None, dim=None)[source]¶
Bases:
object
A simple Bounding Box class for an AABB in R^n
Initialize Geometry Bounds
- Parameters:
center (nd.ndarry, optional) – Center of bounding box. Defaults to None.
size (nd.ndarry, optional) – Size of boundeing box. Defaults to None.
dim (int, optional) – Dimensions of geometric space. Defaults to None.
- Raises:
QiskitError – [description]
Methods
- classmethod combine(bounds1, bounds2)[source]¶
Create the smallest AABB bounding box that includes bounds1 and bounds2
- Parameters:
bounds1 (GeometryBounds) – AABB
bounds2 (GeometryBounds) – AABB
- Returns:
Smallest AABB bounding box that includes bounds1 and bounds2
- Return type:
- contains(point)[source]¶
Returns true is point is within bounds
- Parameters:
point (nd.ndarry) – Point to test
- Returns:
True is point in within bounds. Else, false.
- Return type:
bool
- expand(amount)[source]¶
Expand the bounds of the AABB by increasing its size by amount along each axis
- Parameters:
amount (nd.ndarry) – Vector to increase bounds of AABB along each axis