distance3d.distance.point_to_line_segment

distance3d.distance.point_to_line_segment(point, segment_start, segment_end)[source]

Compute the shortest distance between point and line segment.

Parameters:
pointarray, shape (3,)

3D point.

segment_startarray, shape (3,)

Start point of segment.

segment_endarray, shape (3,)

End point of segment.

Returns:
distancefloat

The shortest distance between point and line segment.

closest_point_line_segmentarray, shape (3,)

Closest point on line segment.