distance2curve

版本 1.1.0.0 (16.3 KB) 作者: John D'Errico
Find the closest point on a (n-dimensional) curve to any given point or set of points
7.5K 次下载
更新时间 2013/2/27

查看许可证

I've seen many people ask for a way to find the closest point on a curve from some given point in space. If the curve is a piecewise linear one, this is not too difficult, since this reduces to finding the closest point on a line segment, and then testing each line segment. (With care, you need not test EVERY line segment.)

For a cubic spline however, this becomes more difficult, but still doable in a mathematical sense without an explicit optimization. Not too much more than roots is necessary.

Distance2curve allows you to specify a set of general points in an n-dimensional space as a connected space curve. A spline (or pchip) is then fit in terms of arc length along the curve, and the closest point identified.

引用格式

John D'Errico (2024). distance2curve (https://www.mathworks.com/matlabcentral/fileexchange/34869-distance2curve), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2011a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Interpolation 的更多信息
致谢

启发作品: jdugge/xy2sn

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.1.0.0

Bug fix: if nargout >= 2

1.0.0.0