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!