필터 지우기
필터 지우기

How to find a common area between three graphs in same plot

조회 수: 2 (최근 30일)
Ijjada Hari
Ijjada Hari 2021년 5월 25일
답변: darova 2021년 5월 25일
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...

채택된 답변

darova
darova 2021년 5월 25일
Do you have polyxpoly?
Try intersections if not

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by