Given one point and some line segments, calculates the euclidean distance between each segment and this point.
If the point lies outside segment, returns the distance between point and nearest extremity of the segment
Parameters : | p1 : numpy.ndarray \((N,3)\)
p2 : numpy.ndarray \((N,3)\)
x : numpy.array(3)
|
---|---|
Returns : | distance : numpy.ndarray \((N)\)
|
Examples
>>> p1 = np.array([[ 0, 0, 0],
... [ 0, 0, 0],
... [ 0, 0, 0]])
>>> p2 = np.array([[ 1, 0, 0],
... [ 0, 1, 0],
... [ 0, 0, 1]])
>>> x = np.array([ 1, 1, 1])
>>> pointSegmentDistance(p1, p2, x)
array([ 1.41421356, 1.41421356, 1.41421356])
>>> x = np.array([ 2, 0, 0])
>>> pointSegmentDistance(p1, p2, x)
array([ 1., 2., 2.])