Fill area of 2dcircle with cross line
5 次查看(过去 30 天)
显示 更早的评论
below is simple circle code, can anyone tell me how to fill this circle with line pattern.
theta=linspace(0,2*pi,100);
x=cos(theta);
y=sin(theta);
plot(x,y)
axis('equal');
xlabel('x')
ylabel('y')
title('circle of unit radius')
0 个评论
采纳的回答
Matt J
2021-12-10
This FEX submission looks applicable:
2 个评论
Image Analyst
2021-12-11
Then could you please award Matt "Reputation points" by clicking the "Accept this answer" link? Thanks in advance. 🙂
更多回答(1 个)
Awais Saeed
2021-12-10
Do not know how to fill with lines, but you can fill the circle as shown below
theta=linspace(0,2*pi,100);
x=cos(theta);
y=sin(theta);
fill(x,y,'g')
axis('equal');
xlabel('x')
ylabel('y')
title('circle of unit radius')
3 个评论
Awais Saeed
2021-12-10
Not exactly the same but somewhat near to the desired output
theta=linspace(0,2*pi,100);
x=cos(theta);
y=sin(theta);
plot(x,y,'black')
for ii = 1:2:length(x)
line([-y(ii),x(ii)],[-x(ii),y(ii)],'Color', 'black','LineWidth',1)
end
axis('equal');
xlabel('x')
ylabel('y')
title('circle of unit radius')
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!