distance between point and line segments

the shortest distance between a line segment and a point

You are now following this Submission

It provides not only the distance between a line segment and a point it also give the position of the nearest point.
v1, and v2 are the starting and ending positions of the line segment, while pt is the position of the point.
source is Malcolm Kesson

Cite As

Mustafa Codur (2026). distance between point and line segments (https://www.mathworks.com/matlabcentral/fileexchange/97462-distance-between-point-and-line-segments), 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.1

e

1.0.0