图像缩略图

曲线交叉点

版本1.5.0.0(2.47 kb) NS
使用矢量化快速计算曲线的交叉点和自我交流。

25.2k下载

更新2010年9月24日

查看许可证

尽管在FEX中已经存在一些其他功能来计算曲线的交叉点,但此简短的代码是编写的,速度是最高优先级。整个循环都没有使用MATLAB的矢量化功能充分利用

I welcome any comments, suggestions, bug reports etc.

------------------------------------------------------------------------------

曲线的Interx交点
P = INTERX(L1,L2) returns the intersection points of two curves L1
和L2。曲线L1,L2可以封闭或打开并描述
通过两行矩阵,其中每行包含其X-和Y-坐标。
一组曲线的相交(例如轮廓线,乘以
连接区域等也可以通过用一个分离它们来计算
column of NaNs as for example

l = [x11 x12 x13 ... nan x21 x22 x23 ...;
Y11 Y12 Y13 ... Nan Y21 Y22 Y23 ...]

P具有与L1和L2相同的结构,其行对应于
L1和L2的交点的X和Y-坐标。如果不
找到交叉点,返回的P为空。

P = INTERX self-int (L1)返回ersection points of L1. To keep
the code simple, the points at which the curve is tangent to itself are
不包含。P = Interx(L1,L1)返回曲线的所有点
以及任何自我交流点。

例子:
t = linspace(0,2*pi);
r1 = sin(4*t)+2;x1 = r1。*cos(t);y1 = r1。*sin(t);
r2 = sin(8*t)+2;x2 = r2。*cos(t);y2 = r2。*sin(t);
p = interx([x1; y1],[x2; y2]);
情节(x1,y1,x2,y2,p(1,:),p(2,:),'ro')

引用为

NS(2022)。曲线交叉点(//www.tatmou.com/matlabcentral/fileexchange/22441-curve-intersections),matlab中央文件交换。检索

MATLAB释放兼容性
使用R2008A创建
与任何版本兼容
平台兼容性
视窗 苹果系统 Linux

社区寻宝

在Matlab Central中找到宝藏,发现社区如何为您提供帮助!

开始狩猎!