绘制一条弧线并与其他线条结合(matlab)

时间:2014-09-16 10:20:54

标签: matlab automatic-ref-counting line

我有一系列的线在一端居中,在另一端打开如下图(蓝线)。我想用一些无线电和与蓝线相同的中心(红线)在它们上面制作一条弧线。目标是在红线和蓝线上有连接点。

enter image description here

第一个问题是如何制作这条曲线? 第二是如何找到连接点

我使用这些代码来制作圆弧,但它不能正常工作,因为它不是直线,它是圆弧点。

enter code here

P1 = [x1;y1];
P2 = [x2;y2];
P0 = [x0;y0];
n = 1000; % The number of points in the arc
v1 = P1-P0;
v2 = P2-P0;
c = det([v1,v2]); % "cross product" of v1 and v2
a = linspace(0,atan2(abs(c),dot(v1,v2)),n); % Angle range
v3 = [0,-c;c,0]*v1; % v3 lies in plane of v1 and v2 and is orthog. to v1
v = v1*cos(a)+((norm(v1)/norm(v3))*v3)*sin(a); % Arc, center at (0,0)
plot(v(1,:)+x0,v(2,:)+y0,'y.') % Plot arc, centered at P0
axis equal

提前感谢

0 个答案:

没有答案