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?

采纳的回答

VBBV
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

更多回答(2 个)

VBBV
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
  1 个评论
AASHNA SUNEJA
AASHNA SUNEJA 2020-10-23
Thank you Vashishta for the help. Actually I want to divide the 2 annular regions in this separately into 14 zones. the smaller annular region want it to be divided into 4 equal zones and the bigger annular region into 10 equal zones and the central circular region remains the same.
Many thanks in advance

请先登录,再进行评论。


AASHNA SUNEJA
AASHNA SUNEJA 2020-10-23
Many thanks Vashishta
I want a smilar sort of figure. I am attaching the figure I want and what I want to do exactly. I want to fill each of these 15 zones according to the experimental value I have. I have tried dowing that by changing the polar cordinates to the cartesian cordinates. But I am not getting the exact results.

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by