Circle
The most important thing in drawing a circle is learning how the circle is drawn using 8-way symmetry. It is based on Mirror reflection. If we see Right hand in the mirror we will see Left hand, Similarly if we see pixel (x,y) in mirror we will see (y,x).
So point P1(x,y) will become P2(y,x) after reflection. Point P3 (-y,x) will become P4 (-x,y) and so on.
Lets understand more how these negative signs are taken. Remember following two things.
One– If we mirror reflect (x,y) with respect to x axis then y will change so it will become (x,-y). Similarly if we reflect point (x,y) with respect to y axis x will change , so the point will become (-x,y).
Two – Read Point (x,y) as : x is on x position and y is on y position, so when we reflect with respect to x axis then y position becomes negative and with respect to y axis x position becomes negative. Take this logic and reflection of point P2 (y,x) with respect to y axis will make the x position negative and not where x is written, so it will become P3 (-y,x).
Reflection of point P8 (x,-y) with respect to x axis will make y position negative and not where y is written, so it will become P1(x,y).
8-Way Symmetry Diagram
The above diagram explains the 8-way symmetry.
Another explanation of the same concept.
This explains the same concept using quadrant. We all know there are four quadrants and
Take the following points and apply the above logic.
Notice that 8 Way Symmetry generates 8 points by taking only one point (x, y) and this forms the circle.
Bresenham’s Circle Algorithm:
Numerical or example of the Bresenham’s circle algorithm for radius 10 is given in another post.
S-1; Enter the center (h, k) and radius(r) of the circle.
S-2: Find d=3-2r and take x = 0 , y = r ; Where r is nothing but the radius of the circle.
S-3: If (d>=0) then x = x +1 and y = y -1 ; d = d + 4*(x-y) + 10; We call d as decision variable.
S-4: if (d <0) then x =x +1 and d = d +4*x + 6;
S-5: Just use the 8 way symmetry and plot following 8 points with one point.
Putpixel (x+h, y+k)
Putpixel (-x+h, y+k)
Putpixel (x+h, -y+k)
Putpixel (-x+h, -y+k)
Putpixel (y+h,x+k)
Putpixel (-y+h,x+k)
Putpixel (y+h,-x+k)
Putpixel (-y+h,-x+k)
S-6: Go to step 3 and repeat till x = r /sqrt(2);
NOTES UNIT-2 ENTREPRENEURIAL PLANNING CLASS-XII SUBJECT- ENTREPRENEURSHIP
There are two ways by which you can see some objects colorful, let's say RED…
What is the formula of Lorentz force q = charge B = Magnetic Fields E…
MCQs on Electrostatic Potential & Capacitance - Chapter 2 - Class 12 CBSELove to Learn…
A. Which out of the following are conductors Metal Human Body Animal Bodies Earth All…
MCQs with answer explanation on - Solutions Chapter -2 Class 12 Prepared by Experts MCQ…