How to find a common area between three graphs in same plot
1 次查看(过去 30 天)
显示 更早的评论
I am trying to find a common are between three circular arcs starting from different center points with same radius covering different angular distances as shown in the figure
Code to plot these graphs is
clc
clear all
radius = 100;
radius1=0:2:100;
xCenter1 = 0;
yCenter1 = 0;
theta1= linspace(90,95,50);
xCenter2 = 20;
yCenter2 = 0;
theta2 = linspace(40,45,50);
xCenter3 = 40;
yCenter3 = 0;
theta3=linspace(135,140,50);
[x1,y1]=req_out(xCenter1,yCenter1,theta1,radius,radius1);
[x2,y2]=req_out(xCenter2,yCenter2,theta2,radius,radius1);
[x3,y3]=req_out(xCenter3,yCenter3,theta3,radius,radius1);
plot(x1,y1,'b-', 'LineWidth', 2)
hold on
plot(x2,y2,'b-', 'LineWidth', 2)
hold on
plot(x3,y3,'b-', 'LineWidth', 2);
hold on
plot(intersect([pgon1,pgon2]),'EdgeColor','none','FaceColor', 'c')
% axis([0 radius+5 0 radius+5])
axis equal
grid on
function [x,y]=req_out(xCenter,yCenter,theta,radius,radius1)
x1=radius1*cosd(min(theta))+ xCenter;
y1=radius1*sind(min(theta))+ yCenter;
x2= radius * cosd(theta) + xCenter;
y2= radius * sind(theta) + yCenter;
x3=radius1*cosd(max(theta))+ xCenter;
y3=radius1*sind(max(theta))+ yCenter;
x=[x1,x2,x3];
y=[y1,y2,y3];
end
Please some one guide me through this...
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/629525/image.jpeg)
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!