p_poly_dist - distance from points to 2D polyline or polygon
Editor's Note: This file was selected as MATLAB Central Pick of the Week
Cite As
Michael Yoshpe (2026). p_poly_dist - distance from points to 2D polyline or polygon (https://www.mathworks.com/matlabcentral/fileexchange/12744-p_poly_dist-distance-from-points-to-2d-polyline-or-polygon), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Acknowledgements
Inspired: Minimum distance between two polylines, p_poly_dist3d - distances between 3D points and a polyline , Distance from a point to polygon, Im2mesh_GUI (2D image to finite element mesh)
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 2.0.0.2 | Fixed a bug that incorrectly sets the distances of out-of-polygon points to negative |
||
| 2.0.0.1 | 1) Small changes to p_poly_dist function to allow translation with Matlab Coder
|
||
| 2.0.0.0 | Fixed a bug that cause idx_c output argument to be off by 1
|
||
| 1.0.0.0 |
