DistBetween2Segment​HP(A1,A2,B1,B2)

Designed for high performance computation. Return distances between N segments and N segments.

You are now following this Submission

This function is designed for high performance computation by avoiding use any loop and judgement statement. It can return N distances between N 2D segments and N 2D segments.
% A1,A2 is the matrix of two points of segment A, N*2
% B1,B2 is the matrix of two points of segment A, N*2
% shortestdistance is the matrix of distances between each two segment N*1
% directionvector indicate the vector of the shortestdistance N*2
% closepointonA and closepointonB is the nearest points on two segments N*2

% by Sky Li All right reserved.
% E-mail: skyliustc@gmail.com

Cite As

Li Ye (2026). DistBetween2SegmentHP(A1,A2,B1,B2) (https://www.mathworks.com/matlabcentral/fileexchange/60279-distbetween2segmenthp-a1-a2-b1-b2), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0