p_spoly_dist

Find shortest distances (angles) from points on a unit sphere to a spherical polyline.

You are now following this Submission

The following files are included:
p_spoly_dist.m - Compute the distances from a set of np points p(i), p(2), ..., p(np) on a unit sphere to the spherical polyline. Spherical polyline is defined as a set of nv-1 great circle arcs connecting nv ordered vertices v(l), v(2), ..., v(nv) on a spherical surface.
In case when all the projected points lie OUTSIDE of all polyline segments, the distance to a closest vertex of the polyline is returned
This function is similar to p_poly_dist function (http://www.mathworks.com/matlabcentral/fileexchange/19398-distance-from-a-point-to-polygon/content/p_poly_dist.m), but instead of Euclidean 2D plane, works on a spherical surface.
test_p_spoly_dist.m - a simple unit test for p_spoly_dist. Plots the results of a call to p_spoly_dist function in 3D
run_s_tests - a script that calls test_p_spoly_dist unit test for different input points and vertices.

Cite As

Michael Yoshpe (2026). p_spoly_dist (https://se.mathworks.com/matlabcentral/fileexchange/52734-p_spoly_dist), MATLAB Central File Exchange. Retrieved .

Categories

Find more on Geoscience in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

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

Added missing slinspace.m file required by the unit test