
how to generate curve up to particular point?
1 次查看(过去 30 天)
显示 更早的评论
I need to generate profile which is combination of multiple curves. I get intersecting point of different curve. I need to remove extra green curve after intersection point.

0 个评论
回答(1 个)
Star Strider
2018-11-16
syms Rb
R1=200;
R3=100;
R2=(R1+R3)/2;
theta=135;
Rb=vpasolve((tan(acos(Rb/R1))-tan(acos(Rb/R2))-(acos(Rb/R1))+(Rb/R2))*(180/pi)==180-theta,Rb);
disp(Rb)
alpha=(tan(acos(Rb/R2))-acos(Rb/R2))*(180/pi);
% disp(alpha)
t=linspace(0,2*pi);
x1=Rb*(cos(t-alpha)+t.*sin(t-alpha));
y1=Rb*(sin(t-alpha)-t.*cos(t-alpha));
x2=R1*cos(t);
y2=R1*sin(t);
x1 = double(x1);
y1 = double(y1);
x2 = double(x2);
y2 = double(y2);
[in,on] = inpolygon(x1, y1, x2, y2); % Find (x1,y1) In Or On (x2,y2)
inon = in | on;
figure
plot(x1,y1, x2, y2)
hold on
hinon = plot(x1(inon),y1(inon), 'pg'); % (x1,y1) In Or On (x2,y2)
hout = plot(x1(~inon),y1(~inon), 'pm') % (x1,y1) Outside (x2,y2)
hold off
legend([hinon,hout], '(x1,y1) In | On (x2,y2)', '(x1,y1) Outside (x2,y2)', 'Location','SE')
I am not certain what you intend with ‘after intersection point’, so I included both options (inside and outside the ellipse), and displayed them with different-colored pentagrams.

2 个评论
Star Strider
2018-11-17
I cannot find a numeric or analytic expression to solve for the intersection that produces reasonable values for both functions, using solve or fsolve.
I would increase the resolution (here ‘N’) in the linspace call to get as close as you can:
N = 1E+5;
t = linspace(0,2*pi,N);
and then go with the smallest distance (as previously), or use Bruno Luong’s suggestion on the File Exchange contribution he cited in his Comment in your earlier Question.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fit Postprocessing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
