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

static bounding_box_from_line(point1, point2)[source]

Create bounding box from points1 and points2

classmethod combine(bounds1, bounds2)[source]

Create the smallest AABB bounding box that includes bounds1 and bounds2

Parameters:
Returns:

Smallest AABB bounding box that includes bounds1 and bounds2

Return type:

GeometryBounds

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

copy()[source]

Copying self

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

intercepts(line)[source]

Returns the intercepts of the input line with the aabb.

The line is inputed as a vector [a,b,c] which represents the line given by ax+by=c

Parameters:

line (List[float, float, float]) – _description_

Returns:

_description_

Return type:

List

set_min_max(min_point, max_point)[source]

Set the bound max to be max_point and bound min to min_point

Parameters:
  • min_point (nd.ndarry) – min point

  • max_point (nd.ndarry) – max