p_poly_dist3d - distances between 3D points and a polyline
Version 1.0.1 (4.82 KB) by
Michael Yoshpe
Distances between set of 3D points and a 3D polyline
The following files are included:
p_poly_dist3d - function to compute the distances between a set of np 3D points and a 3D polyline, defined by nv 3D vertices. The distance from some point P(j,:) to a polline V is defined as following:
- EITHER a shortest distance from a point P(j,:) to it's projection on a 3D line defined by a segment V(k,:), V(k+1,:), when this projection falls INSIDE a segment k;
- OR as a distance from a point P(j, :) to a closest vertex V(k,:), when the projection falls OUTSIDE of a segment.
test_p_poly_dist3d - a simple script that calls p_poly_dist3d and plots the results. This script computes the distances between points on a 3D straight line, and a helix spiral polyline.
This is a 3D extension of my p_poly_dist 2D function
Cite As
Michael Yoshpe (2026). p_poly_dist3d - distances between 3D points and a polyline (https://uk.mathworks.com/matlabcentral/fileexchange/182862-p_poly_dist3d-distances-between-3d-points-and-a-polyline), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2017b
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Acknowledgements
Inspired by: p_poly_dist - distance from points to 2D polyline or polygon
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
