distance3d.distance.point_to_rectangle

distance3d.distance.point_to_rectangle(point, rectangle_center, rectangle_axes, rectangle_lengths)[source]

Compute the shortest distance from point to rectangle.

Parameters:
pointarray, shape (3,)

3D point.

rectangle_centerarray, shape (3,)

Center point of the rectangle.

rectangle_axesarray, shape (2, 3)

Each row is a vector of unit length, indicating the direction of one axis of the rectangle. Both vectors are orthogonal.

rectangle_lengthsarray, shape (2,)

Lengths of the two sides of the rectangle.

Returns:
distfloat

The shortest distance between the point and the rectangle.

closest_point_rectanglearray, shape (3,)

Closest point on the rectangle.