-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjapan.m
35 lines (25 loc) · 843 Bytes
/
japan.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
% 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
%loop for rows i.e. for x-axis
for i = 101:200
%loop for columns i.e. for y-axis
for j = 101:300
%applying the equation of circle to make the circle in the center.
if round(sqrt((i-circle_center1)^2 + (j-circle_center2)^2)) < radius^2
% fill the circle with crimson glory
% color using RGB color representation.
I(i, j, 1) = 188;
I(i, j, 2) = 0;
I(i, j, 3) = 45;
end
end % end column loop.
end % end row loop.
% show the image formed.
figure, imshow(I);