Need to create filled circles with a solid border that iterate over each other.
조회 수: 3 (최근 30일)
이전 댓글 표시
I am designing code that is ment to simulate impacts on a surface. it creates circles that land on top of each other. I would like each craterr to be a filled crater with a hard border such as a a black circle with a blue border so that it covers previous crater borders.
댓글 수: 0
답변 (2개)
Voss
2023년 11월 14일
xy = [0 0; 1 1; 2.5 0.5; -2 -1] % crater centers
r = [3; 2; 1; 2] % crater radii
% use patch to create the circles:
figure
axis equal
ax = gca();
th = linspace(0,2*pi,100);
for ii = 1:size(xy,1)
patch(ax,xy(ii,1)+r(ii)*cos(th),xy(ii,2)+r(ii)*sin(th),'k','EdgeColor','b');
end
댓글 수: 0
Image Analyst
2023년 11월 15일
If you want it as a digital image, see my attached demo. Feel free to adapt it to your needs.

댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
