资源简介
function [xy,distance,t_a] = distance2curve(curvexy,mapxy,interpmethod)
% distance2curve: minimum distance from a point to a general curvilinear n-dimensional arc
% usage: [xy,distance,t] = distance2curve(curvexy,mapxy) % uses linear curve segments
% usage: [xy,distance,t] = distance2curve(curvexy,mapxy,interpmethod)
代码片段和文件信息
function [xydistancet_a] = distance2curve(curvexymapxyinterpmethod)
% distance2curve: minimum distance from a point to a general curvilinear n-dimensional arc
% usage: [xydistancet] = distance2curve(curvexymapxy) % uses linear curve segments
% usage: [xydistancet] = distance2curve(curvexymapxyinterpmethod)
%
% Identifies the closest point along a general space curve (a 1-d path
% in some space) to some new set of points. The curve may be piecewise
% linear or a parametric spline or pchip model.
%
% arguments: (input)
% curvexy - An nxp real numeric array containing the points of the
% curve. For 2-dimensional curves p == 2. This will be a list
% of points (each row of the array is a new point) that
% define the curve. The curve may cross itself in space.
% Closed curves are acceptable in which case the first
% and last points would be identical. (Sorry but periodic
% end conditions are not an option for the spline at this time.)
%
% Since a curve makes no sense in less than 2 dimensions
% p >= 2 is required.
%
% mapxy - an mxp real numeric array where m is the number of new points
% to be mapped to the curve in term of their closest distance.
%
% These points which will be mapped to the existing curve
% in terms of the minimium (euclidean 2-norm) distance
% to the curve. Each row of this array will be a different
% point.
%
% interpmethod - (OPTIONAL) string flag - denotes the method
% used to compute the arc length of the curve.
%
% method may be any of ‘linear‘ ‘spline‘ or ‘pchip‘
% or any simple contraction thereof such as ‘lin‘
% ‘sp‘ or even ‘p‘.
%
% interpmethod == ‘linear‘ --> Uses a linear chordal
% approximation to define the curve.
% This method is the most efficient.
%
% interpmethod == ‘pchip‘ --> Fits a parametric pchip
% approximation.
%
% interpmethod == ‘spline‘ --> Uses a parametric spline
% approximation to fit the curves. Generally for
% a smooth curve this method may be most accurate.
%
% DEFAULT: ‘linear‘
%
% arguments: (output)
% xy - an mxp array contains the closest point identified along
% the curve to each of the points provided in mapxy.
%
% distance - an mx1 vector the actual distance to the curve
% in terms minimum Euclidean distance.
%
% t - fractional arc length along the interpolating curve to that
% point. This is the same value that interparc would use to
% produce the points in xy.
%
%
% Example:
% % Find the closest points and the distance to a polygonal line from
% % several test points.
%
% curvexy = [0 0;1 0;2 1;0 .5;0 0];
% mapxy = [3 4;.5 .5;3 -1];
% [xydistancet] = distance2curve(curvexymapxy‘linear‘)
% % xy =
% % 2
- 上一篇:三相整流器滞环直接功率控制simuli
nk - 下一篇:6R机械臂正逆解程序
相关资源
- Pattern Recognition and Machine Learning(高清
- MATLAB 编程 第二版 Stephen J. Chapman 著
- 均值滤波和FFT频谱分析Matlab代码
- 《MATLAB扩展编程》代码
- HDB3码、AMI码的MATLAB实现
- 3点GPS定位MATLAB仿真
- MATLAB数字信号处理85个实用案例精讲入
- matlab从入门到精通pdf94795
- 欧拉放大论文及matlab代码
- 跳一跳辅助_matlab版本
- 全面详解LTE MATLAB建模、仿真与实现
- MIMO-OFDM无线通信技术及MATLAB实现_孙锴
- MATLAB Programming for Engineers 4th - Chapman
- matlab 各种谱分析对比
- 分数阶chen混沌matlab程序
- 基于粒子群算法的非合作博弈的matl
- MATLAB车流仿真 包括跟驰、延误
- matlab空间桁架计算程序
- 基于MATLAB的图像特征点匹配和筛选
- DMA-TVP-FAVAR
- GPS信号的码捕获matlab代码.7z
- 一维光子晶体MATLAB仿真代码吸收率折
- newmark法源程序
- 传统关联成像、计算鬼成像matlab
- pri传统分选算法
- 摆动滚子推杆盘形凸轮设计
- 医学图像重建作业matlab源码
- Matlab实现混沌系统的控制
- 检测疲劳驾驶
- Matlab锁相环仿真-Phase Locked Loop.rar
评论
共有 条评论