• Remix
  • Share
  • New Entry

on 30 Oct 2021
  • 1
  • 95
  • 1
  • 0
  • 259
% create a 2-D matrix and paint it white
I = uint8(zeros(300, 500, 3))+255;
%the center point 1 through which the circle will pass
circle_center1=150;
%the center point 2 through which the circle will pass
circle_center2=250;
radius=6.32; % radius of the circle
x=i; % x-axis co-ordinate
y=j; % y-axis co-ordinate
for i = 101:200
for j = 101:300
if round(sqrt((i-circle_center1)^2 + (j-circle_center2)^2)) < radius^2
I(i, j, 1) = 188;
I(i, j, 2) = 0;
I(i, j, 3) = 45;
end
end % end column loop.
end % end row loop.
figure(), imshow(I);
Warning: Ignoring 'Colormap' parameter provided with a truecolor image.
Remix Tree