How to Segment an annulus made out of two circles
3 次查看(过去 30 天)
显示 更早的评论
r = 1; %inner radius
xCenter = 5;
yCenter = 5;
theta = 0 : 0.01 : 2*pi;
x = r * cos(theta) + xCenter;
y = r * sin(theta) + yCenter;
plot(x, y, 'LineWidth', 3);
axis square;
xlim([2 8]);
ylim([2 8]);
grid on;
hold on
R = 2; %outer radius
XCenter = 5;
YCenter = 5;
theta = 0 : 0.01 : 2*pi;
X = R * cos(theta) + XCenter;
Y = R * sin(theta) + YCenter;
plot(X, Y, 'LineWidth', 3);
axis square;
xlim([2 8]);
ylim([2 8]);
grid on;
hold off
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1188058/image.png)
0 个评论
回答(1 个)
Image Analyst
2022-11-10
To specify sectors, adjust the starting and stopping angles when you make theta:
theta = 0 : 0.01 : 2*pi;
0 个评论
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!