a circle is divided using 2 by inscribing 2 circles how can we divide three regions obtained from it into equal 15 zones
조회 수: 3 (최근 30일)
이전 댓글 표시
a = linspace(0, 2*pi, 100);
r1 = 100;
r2=58;
r3=25;
x = r1*cos(a);
y = r1*sin(a);
x1 = r2*cos(a);
y1 = r2*sin(a);
x2 = r3*cos(a);
y2 = r3*sin(a);
N=10
N1=4
figure(1)
plot(x, y,'k')
hold on
plot(x1, y1,'r')
plot([zeros(1,N); x(1:10:end)], [zeros(1,N); y(1:10:end)])
plot(x2, y2,'b')
hold off
axis equal
From this code I have been able to divide a single circle to 3 areas with centeral region a circle and rest two are tube shaped area then I want to divide area except the central circular area to 14 equal zones. how can i do this?
댓글 수: 0
채택된 답변
VBBV
2020년 10월 23일
편집: VBBV
2020년 10월 23일
See the fig attached, is the same figure you want, if i understand it right
N = 4; % divides to 4 parts
N1 = 10;
a = linspace(0, 2*pi, N*10);
a1 = linspace(0,2*pi, N1*10);
r1 = 100;
r2=58;
r3=25;
x = r1*cos(a1);
y = r1*sin(a1);
x1 = r2*cos(a1);
y1 = r2*sin(a1);
x2 = r3*cos(a);
y2 = r3*sin(a);
figure(1)
plot(x, y,'k')
hold on
plot([x1(1:10:end);x(1:10:end)], [y1(1:10:end);y(1:10:end)])
hold on
x1 = r2*cos(a);
y1 = r2*sin(a);
plot(x1, y1,'r')
plot([x2(1:10:end); x1(1:10:end)], [y2(1:10:end); y1(1:10:end)])
plot(x2, y2,'b')
hold off
axis equal
댓글 수: 0
추가 답변 (2개)
VBBV
2020년 10월 23일
편집: VBBV
2020년 10월 23일
Try this . it works , change the value of N to number of equal parts you want
N = 15; % divides to 15 parts
a = linspace(0, 2*pi, N*10);
r1 = 100;
r2=58;
r3=25;
x = r1*cos(a);
y = r1*sin(a);
x1 = r2*cos(a);
y1 = r2*sin(a);
x2 = r3*cos(a);
y2 = r3*sin(a);
figure(1)
plot(x, y,'k')
hold on
plot(x1, y1,'r')
plot([zeros(1,N); x(1:10:end)], [zeros(1,N); y(1:10:end)])
fill(x2, y2,'w')
hold off
axis equal
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!