Category: Subjects

2D Shearing in Computer Graphics | Definition | Examples

2D Transformations in Computer Graphics-

 

We have discussed-

  • Transformation is a process of modifying and re-positioning the existing graphics.
  • 2D Transformations take place in a two dimensional plane.

 

In computer graphics, various transformation techniques are-

 

 

  1. Translation
  2. Rotation
  3. Scaling
  4. Reflection
  5. Shear

 

In this article, we will discuss about 2D Shearing in Computer Graphics.

 

2D Shearing in Computer Graphics-

 

In Computer graphics,

2D Shearing is an ideal technique to change the shape of an existing object in a two dimensional plane.

 

In a two dimensional plane, the object size can be changed along X direction as well as Y direction.

So, there are two versions of shearing-

 

 

  1. Shearing in X direction
  2. Shearing in Y direction

 

Consider a point object O has to be sheared in a 2D plane.

 

Let-

  • Initial coordinates of the object O = (Xold, Yold)
  • Shearing parameter towards X direction = Shx
  • Shearing parameter towards Y direction = Shy
  • New coordinates of the object O after shearing = (Xnew, Ynew)

 

Shearing in X Axis-

 

Shearing in X axis is achieved by using the following shearing equations-

  • Xnew = Xold + Shx x Yold
  • Ynew = Yold

 

In Matrix form, the above shearing equations may be represented as-

 

 

For homogeneous coordinates, the above shearing matrix may be represented as a 3 x 3 matrix as-

 

 

Shearing in Y Axis-

 

Shearing in Y axis is achieved by using the following shearing equations-

  • Xnew = Xold
  • Ynew = Yold + Shy x Xold

 

In Matrix form, the above shearing equations may be represented as-

 

 

For homogeneous coordinates, the above shearing matrix may be represented as a 3 x 3 matrix as-

 

 

PRACTICE PROBLEMS BASED ON 2D SHEARING IN COMPUTER GRAPHICS-

 

Problem-01:

 

Given a triangle with points (1, 1), (0, 0) and (1, 0). Apply shear parameter 2 on X axis and 2 on Y axis and find out the new coordinates of the object.

 

Solution-

 

Given-

  • Old corner coordinates of the triangle = A (1, 1), B(0, 0), C(1, 0)
  • Shearing parameter towards X direction (Shx) = 2
  • Shearing parameter towards Y direction (Shy) = 2

 

Shearing in X Axis-

 

For Coordinates A(1, 1)

 

Let the new coordinates of corner A after shearing = (Xnew, Ynew).

 

Applying the shearing equations, we have-

  • Xnew = Xold + Shx x Yold = 1 + 2 x 1 = 3
  • Ynew = Yold = 1

 

Thus, New coordinates of corner A after shearing = (3, 1).

 

For Coordinates B(0, 0)

 

Let the new coordinates of corner B after shearing = (Xnew, Ynew).

 

Applying the shearing equations, we have-

  • Xnew = Xold + Shx x Yold = 0 + 2 x 0 = 0
  • Ynew = Yold = 0

 

Thus, New coordinates of corner B after shearing = (0, 0).

 

For Coordinates C(1, 0)

 

Let the new coordinates of corner C after shearing = (Xnew, Ynew).

 

Applying the shearing equations, we have-

  • Xnew = Xold + Shx x Yold = 1 + 2 x 0 = 1
  • Ynew = Yold = 0

 

Thus, New coordinates of corner C after shearing = (1, 0).

Thus, New coordinates of the triangle after shearing in X axis = A (3, 1), B(0, 0), C(1, 0).

 

Shearing in Y Axis-

 

For Coordinates A(1, 1)

 

Let the new coordinates of corner A after shearing = (Xnew, Ynew).

 

Applying the shearing equations, we have-

  • Xnew = Xold = 1
  • Ynew = Yold + Shy x Xold = 1 + 2 x 1 = 3

 

Thus, New coordinates of corner A after shearing = (1, 3).

 

For Coordinates B(0, 0)

 

Let the new coordinates of corner B after shearing = (Xnew, Ynew).

 

Applying the shearing equations, we have-

  • Xnew = Xold = 0
  • Ynew = Yold + Shy x Xold = 0 + 2 x 0 = 0

 

Thus, New coordinates of corner B after shearing = (0, 0).

 

For Coordinates C(1, 0)

 

Let the new coordinates of corner C after shearing = (Xnew, Ynew).

 

Applying the shearing equations, we have-

  • Xnew = Xold = 1
  • Ynew = Yold + Shy x Xold = 0 + 2 x 1 = 2

 

Thus, New coordinates of corner C after shearing = (1, 2).

Thus, New coordinates of the triangle after shearing in Y axis = A (1, 3), B(0, 0), C(1, 2).

 

 

To gain better understanding about 2D Shearing in Computer Graphics,

Watch this Video Lecture

 

Get more notes and other study material of Computer Graphics.

Watch video lectures by visiting our YouTube channel LearnVidFun.

2D Reflection in Computer Graphics | Definition | Examples

2D Transformations in Computer Graphics-

 

We have discussed-

  • Transformation is a process of modifying and re-positioning the existing graphics.
  • 2D Transformations take place in a two dimensional plane.

 

In computer graphics, various transformation techniques are-

 

 

  1. Translation
  2. Rotation
  3. Scaling
  4. Reflection
  5. Shear

 

In this article, we will discuss about 2D Reflection in Computer Graphics.

 

2D Reflection in Computer Graphics-

 

  • Reflection is a kind of rotation where the angle of rotation is 180 degree.
  • The reflected object is always formed on the other side of mirror.
  • The size of reflected object is same as the size of original object.

 

Consider a point object O has to be reflected in a 2D plane.

 

Let-

  • Initial coordinates of the object O = (Xold, Yold)
  • New coordinates of the reflected object O after reflection = (Xnew, Ynew)

 

Reflection On X-Axis:

 

This reflection is achieved by using the following reflection equations-

  • Xnew = Xold
  • Ynew = -Yold

 

In Matrix form, the above reflection equations may be represented as-

 

 

For homogeneous coordinates, the above reflection matrix may be represented as a 3 x 3 matrix as-

 

 

Reflection On Y-Axis:

 

This reflection is achieved by using the following reflection equations-

  • Xnew = -Xold
  • Ynew = Yold

 

In Matrix form, the above reflection equations may be represented as-

 

 

For homogeneous coordinates, the above reflection matrix may be represented as a 3 x 3 matrix as-

 

 

PRACTICE PROBLEMS BASED ON 2D REFLECTION IN COMPUTER GRAPHICS-

 

Problem-01:

 

Given a triangle with coordinate points A(3, 4), B(6, 4), C(5, 6). Apply the reflection on the X axis and obtain the new coordinates of the object.

 

Solution-

 

Given-

  • Old corner coordinates of the triangle = A (3, 4), B(6, 4), C(5, 6)
  • Reflection has to be taken on the X axis

 

For Coordinates A(3, 4)

 

Let the new coordinates of corner A after reflection = (Xnew, Ynew).

 

Applying the reflection equations, we have-

  • Xnew = Xold = 3
  • Ynew = -Yold = -4

 

Thus, New coordinates of corner A after reflection = (3, -4).

 

For Coordinates B(6, 4)

 

Let the new coordinates of corner B after reflection = (Xnew, Ynew).

 

Applying the reflection equations, we have-

  • Xnew = Xold = 6
  • Ynew = -Yold = -4

 

Thus, New coordinates of corner B after reflection = (6, -4).

 

For Coordinates C(5, 6)

 

Let the new coordinates of corner C after reflection = (Xnew, Ynew).

 

Applying the reflection equations, we have-

  • Xnew = Xold = 5
  • Ynew = -Yold = -6

 

Thus, New coordinates of corner C after reflection = (5, -6).

 

Thus, New coordinates of the triangle after reflection = A (3, -4), B(6, -4), C(5, -6).

 

 

Problem-02:

 

Given a triangle with coordinate points A(3, 4), B(6, 4), C(5, 6). Apply the reflection on the Y axis and obtain the new coordinates of the object.

 

Solution-

 

Given-

  • Old corner coordinates of the triangle = A (3, 4), B(6, 4), C(5, 6)
  • Reflection has to be taken on the Y axis

 

For Coordinates A(3, 4)

 

Let the new coordinates of corner A after reflection = (Xnew, Ynew).

 

Applying the reflection equations, we have-

  • Xnew = -Xold = -3
  • Ynew = Yold = 4

 

Thus, New coordinates of corner A after reflection = (-3, 4).

 

For Coordinates B(6, 4)

 

Let the new coordinates of corner B after reflection = (Xnew, Ynew).

 

Applying the reflection equations, we have-

  • Xnew = -Xold = -6
  • Ynew = Yold = 4

 

Thus, New coordinates of corner B after reflection = (-6, 4).

 

For Coordinates C(5, 6)

 

Let the new coordinates of corner C after reflection = (Xnew, Ynew).

 

Applying the reflection equations, we have-

  • Xnew = -Xold = -5
  • Ynew = Yold = 6

 

Thus, New coordinates of corner C after reflection = (-5, 6).

 

Thus, New coordinates of the triangle after reflection = A (-3, 4), B(-6, 4), C(-5, 6).

 

 

To gain better understanding about 2D Reflection in Computer Graphics,

Watch this Video Lecture

 

Next Article- 2D Shearing in Computer Graphics

 

Get more notes and other study material of Computer Graphics.

Watch video lectures by visiting our YouTube channel LearnVidFun.

2D Rotation in Computer Graphics | Definition | Examples

2D Transformations in Computer Graphics-

 

We have discussed-

  • Transformation is a process of modifying and re-positioning the existing graphics.
  • 2D Transformations take place in a two dimensional plane.

 

In computer graphics, various transformation techniques are-

 

 

  1. Translation
  2. Rotation
  3. Scaling
  4. Reflection
  5. Shear

 

In this article, we will discuss about 2D Rotation in Computer Graphics.

 

2D Rotation in Computer Graphics-

 

In Computer graphics,

2D Rotation is a process of rotating an object with respect to an angle in a two dimensional plane.

 

Consider a point object O has to be rotated from one angle to another in a 2D plane.

 

Let-

  • Initial coordinates of the object O = (Xold, Yold)
  • Initial angle of the object O with respect to origin = Φ
  • Rotation angle = θ
  • New coordinates of the object O after rotation = (Xnew, Ynew)

 

 

This rotation is achieved by using the following rotation equations-

  • Xnew = Xold x cosθ – Yold x sinθ
  • Ynew = Xold x sinθ + Yold x cosθ

 

In Matrix form, the above rotation equations may be represented as-

 

 

For homogeneous coordinates, the above rotation matrix may be represented as a 3 x 3 matrix as-

 

 

PRACTICE PROBLEMS BASED ON 2D ROTATION IN COMPUTER GRAPHICS-

 

Problem-01:

 

Given a line segment with starting point as (0, 0) and ending point as (4, 4). Apply 30 degree rotation anticlockwise direction on the line segment and find out the new coordinates of the line.

 

Solution-

 

We rotate a straight line by its end points with the same angle. Then, we re-draw a line between the new end points.

 

Given-

  • Old ending coordinates of the line = (Xold, Yold) = (4, 4)
  • Rotation angle = θ = 30º

 

Let new ending coordinates of the line after rotation = (Xnew, Ynew).

 

Applying the rotation equations, we have-

 

Xnew

= Xold x cosθ – Yold x sinθ

= 4 x cos30º – 4 x sin30º

= 4 x (√3 / 2) – 4 x (1 / 2)

= 2√3 – 2

= 2(√3 – 1)

= 2(1.73 – 1)

= 1.46

 

Ynew

= Xold x sinθ + Yold x cosθ

= 4 x sin30º + 4 x cos30º

= 4 x (1 / 2) + 4 x (√3 / 2)

= 2 + 2√3

= 2(1 + √3)

= 2(1 + 1.73)

= 5.46

 

Thus, New ending coordinates of the line after rotation = (1.46, 5.46).

 

Alternatively,

 

In matrix form, the new ending coordinates of the line after rotation may be obtained as-

 

 

Thus, New ending coordinates of the line after rotation = (1.46, 5.46).

 

 

Problem-02:

 

Given a triangle with corner coordinates (0, 0), (1, 0) and (1, 1). Rotate the triangle by 90 degree anticlockwise direction and find out the new coordinates.

 

Solution-

 

We rotate a polygon by rotating each vertex of it with the same rotation angle.

 

Given-

  • Old corner coordinates of the triangle = A (0, 0), B(1, 0), C(1, 1)
  • Rotation angle = θ = 90º

 

For Coordinates A(0, 0)

 

Let the new coordinates of corner A after rotation = (Xnew, Ynew).

 

Applying the rotation equations, we have-

 

Xnew

= Xold x cosθ – Yold x sinθ

= 0 x cos90º – 0 x sin90º

= 0

 

Ynew

= Xold x sinθ + Yold x cosθ

= 0 x sin90º + 0 x cos90º

= 0

 

Thus, New coordinates of corner A after rotation = (0, 0).

 

For Coordinates B(1, 0)

 

Let the new coordinates of corner B after rotation = (Xnew, Ynew).

 

Xnew

= Xold x cosθ – Yold x sinθ

= 1 x cos90º – 0 x sin90º

= 0

 

Ynew

= Xold x sinθ + Yold x cosθ

= 1 x sin90º + 0 x cos90º

= 1 + 0

= 1

 

Thus, New coordinates of corner B after rotation = (0, 1).

 

For Coordinates C(1, 1)

 

Let the new coordinates of corner C after rotation = (Xnew, Ynew).

 

Xnew

= Xold x cosθ – Yold x sinθ

= 1 x cos90º – 1 x sin90º

= 0 – 1

= -1

 

Ynew

= Xold x sinθ + Yold x cosθ

= 1 x sin90º + 1 x cos90º

= 1 + 0

= 1

 

Thus, New coordinates of corner C after rotation = (-1, 1).

 

Thus, New coordinates of the triangle after rotation = A (0, 0), B(0, 1), C(-1, 1).

 

 

To gain better understanding about 2D Rotation in Computer Graphics,

Watch this Video Lecture

 

Next Article- 2D Scaling in Computer Graphics

 

Get more notes and other study material of Computer Graphics.

Watch video lectures by visiting our YouTube channel LearnVidFun.

2D Translation in Computer Graphics | Definition | Examples

2D Transformation in Computer Graphics-

 

In Computer graphics,

Transformation is a process of modifying and re-positioning the existing graphics.

 

  • 2D Transformations take place in a two dimensional plane.
  • Transformations are helpful in changing the position, size, orientation, shape etc of the object.

 

Transformation Techniques-

 

In computer graphics, various transformation techniques are-

 

 

  1. Translation
  2. Rotation
  3. Scaling
  4. Reflection
  5. Shear

 

In this article, we will discuss about 2D Translation in Computer Graphics.

 

2D Translation in Computer Graphics-

 

In Computer graphics,

2D Translation is a process of moving an object from one position to another in a two dimensional plane.

 

Consider a point object O has to be moved from one position to another in a 2D plane.

 

Let-

  • Initial coordinates of the object O = (Xold, Yold)
  • New coordinates of the object O after translation = (Xnew, Ynew)
  • Translation vector or Shift vector = (Tx, Ty)

 

Given a Translation vector (Tx, Ty)-

  • Tx defines the distance the Xold coordinate has to be moved.
  • Ty defines the distance the Yold coordinate has to be moved.

 

 

This translation is achieved by adding the translation coordinates to the old coordinates of the object as-

  • Xnew = Xold + Tx     (This denotes translation towards X axis)
  • Ynew = Yold + Ty     (This denotes translation towards Y axis)

 

In Matrix form, the above translation equations may be represented as-

 

 

  • The homogeneous coordinates representation of (X, Y) is (X, Y, 1).
  • Through this representation, all the transformations can be performed using matrix / vector multiplications.

 

The above translation matrix may be represented as a 3 x 3 matrix as-

 

 

PRACTICE PROBLEMS BASED ON 2D TRANSLATION IN COMPUTER GRAPHICS-

 

Problem-01:

 

Given a circle C with radius 10 and center coordinates (1, 4). Apply the translation with distance 5 towards X axis and 1 towards Y axis. Obtain the new coordinates of C without changing its radius.

 

Solution-

 

Given-

  • Old center coordinates of C = (Xold, Yold) = (1, 4)
  • Translation vector = (Tx, Ty) = (5, 1)

 

Let the new center coordinates of C = (Xnew, Ynew).

 

Applying the translation equations, we have-

  • Xnew = Xold + Tx = 1 + 5 = 6
  • Ynew = Yold + Ty = 4 + 1 = 5

 

Thus, New center coordinates of C = (6, 5).

 

Alternatively,

 

In matrix form, the new center coordinates of C after translation may be obtained as-

 

 

Thus, New center coordinates of C = (6, 5).

 

 

Problem-02:

 

Given a square with coordinate points A(0, 3), B(3, 3), C(3, 0), D(0, 0). Apply the translation with distance 1 towards X axis and 1 towards Y axis. Obtain the new coordinates of the square.

 

Solution-

 

Given-

  • Old coordinates of the square = A (0, 3), B(3, 3), C(3, 0), D(0, 0)
  • Translation vector = (Tx, Ty) = (1, 1)

 

For Coordinates A(0, 3)

 

Let the new coordinates of corner A = (Xnew, Ynew).

 

Applying the translation equations, we have-

  • Xnew = Xold + Tx = 0 + 1 = 1
  • Ynew = Yold + Ty = 3 + 1 = 4

 

Thus, New coordinates of corner A = (1, 4).

 

For Coordinates B(3, 3)

 

Let the new coordinates of corner B = (Xnew, Ynew).

 

Applying the translation equations, we have-

  • Xnew = Xold + Tx = 3 + 1 = 4
  • Ynew = Yold + Ty = 3 + 1 = 4

 

Thus, New coordinates of corner B = (4, 4).

 

For Coordinates C(3, 0)

 

Let the new coordinates of corner C = (Xnew, Ynew).

 

Applying the translation equations, we have-

  • Xnew = Xold + Tx = 3 + 1 = 4
  • Ynew = Yold + Ty = 0 + 1 = 1

 

Thus, New coordinates of corner C = (4, 1).

 

For Coordinates D(0, 0)

 

Let the new coordinates of corner D = (Xnew, Ynew).

 

Applying the translation equations, we have-

  • Xnew = Xold + Tx = 0 + 1 = 1
  • Ynew = Yold + Ty = 0 + 1 = 1

 

Thus, New coordinates of corner D = (1, 1).

Thus, New coordinates of the square = A (1, 4), B(4, 4), C(4, 1), D(1, 1).

 

 

To gain better understanding about 2D Translation in Computer Graphics,

Watch this Video Lecture

 

Next Article- 2D Rotation in Computer Graphics

 

Get more notes and other study material of Computer Graphics.

Watch video lectures by visiting our YouTube channel LearnVidFun.

Bresenham Circle Drawing Algorithm

Circle Drawing Algorithms-

 

In computer graphics, popular algorithms used to generate circle are-

 

 

  1. Mid Point Circle Drawing Algorithm
  2. Bresenham Circle Drawing Algorithm

 

In this article, we will discuss about Bresenham Circle Drawing Algorithm.

 

Bresenham Circle Drawing Algorithm-

 

Given the centre point and radius of circle,

Bresenham Circle Drawing Algorithm attempts to generate the points of one octant.

 

The points for other octacts are generated using the eight symmetry property.

 

Also Read- Mid Point Circle Drawing Algorithm

 

Procedure-

 

Given-

  • Centre point of Circle = (X0, Y0)
  • Radius of Circle = R

 

The points generation using Bresenham Circle Drawing Algorithm involves the following steps-

 

Step-01:

 

Assign the starting point coordinates (X0, Y0) as-

  • X0 = 0
  • Y0 = R

 

Step-02:

 

Calculate the value of initial decision parameter P0 as-

P0 = 3 – 2 x R

 

Step-03:

 

Suppose the current point is (Xk, Yk) and the next point is (Xk+1, Yk+1).

Find the next point of the first octant depending on the value of decision parameter Pk.

Follow the below two cases-

 

 

Step-04:

 

If the given centre point (X0, Y0) is not (0, 0), then do the following and plot the point-

  • Xplot = Xc + X0
  • Yplot = Yc + Y0

 

Here, (Xc, Yc) denotes the current value of X and Y coordinates.

 

Step-05:

 

Keep repeating Step-03 and Step-04 until Xplot => Yplot.

 

Step-06:

 

Step-05 generates all the points for one octant.

To find the points for other seven octants, follow the eight symmetry property of circle.

This is depicted by the following figure-

 

 

PRACTICE PROBLEMS BASED ON BRESENHAM CIRCLE DRAWING ALGORITHM-

 

Problem-01:

 

Given the centre point coordinates (0, 0) and radius as 8, generate all the points to form a circle.

 

Solution-

 

Given-

  • Centre Coordinates of Circle (X0, Y0) = (0, 0)
  • Radius of Circle = 8

 

Step-01:

 

Assign the starting point coordinates (X0, Y0) as-

  • X0 = 0
  • Y0 = R = 8

 

Step-02:

 

Calculate the value of initial decision parameter P0 as-

P0 = 3 – 2 x R

P0 = 3 – 2 x 8

P0 = -13

 

Step-03:

 

As Pinitial < 0, so case-01 is satisfied.

 

Thus,

  • Xk+1 = Xk + 1 = 0 + 1 = 1
  • Yk+1 = Yk = 8
  • Pk+1 = Pk + 4 x Xk+1 + 6 = -13 + (4 x 1) + 6 = -3

 

Step-04:

 

This step is not applicable here as the given centre point coordinates is (0, 0).

 

Step-05:

 

Step-03 is executed similarly until Xk+1 >= Yk+1 as follows-

 

Pk Pk+1 (Xk+1, Yk+1)
(0, 8)
-13 -3 (1, 8)
-3 11 (2, 8)
11 5 (3, 7)
5 7 (4, 6)
7 (5, 5)
Algorithm Terminates

These are all points for Octant-1.

 

Algorithm calculates all the points of octant-1 and terminates.

Now, the points of octant-2 are obtained using the mirror effect by swapping X and Y coordinates.

 

Octant-1 Points Octant-2 Points
(0, 8) (5, 5)
(1, 8) (6, 4)
(2, 8) (7, 3)
(3, 7) (8, 2)
(4, 6) (8, 1)
(5, 5) (8, 0)
These are all points for Quadrant-1.

 

Now, the points for rest of the part are generated by following the signs of other quadrants.

The other points can also be generated by calculating each octant separately.

 

Here, all the points have been generated with respect to quadrant-1-

 

Quadrant-1 (X,Y) Quadrant-2 (-X,Y) Quadrant-3 (-X,-Y) Quadrant-4 (X,-Y)
(0, 8) (0, 8) (0, -8) (0, -8)
(1, 8) (-1, 8) (-1, -8) (1, -8)
(2, 8) (-2, 8) (-2, -8) (2, -8)
(3, 7) (-3, 7) (-3, -7) (3, -7)
(4, 6) (-4, 6) (-4, -6) (4, -6)
(5, 5) (-5, 5) (-5, -5) (5, -5)
(6, 4) (-6, 4) (-6, -4) (6, -4)
(7, 3) (-7, 3) (-7, -3) (7, -3)
(8, 2) (-8, 2) (-8, -2) (8, -2)
(8, 1) (-8, 1) (-8, -1) (8, -1)
(8, 0) (-8, 0) (-8, 0) (8, 0)
These are all points of the Circle.

 

Problem-02:

 

Given the centre point coordinates (10, 10) and radius as 10, generate all the points to form a circle.

 

Solution-

 

Given-

  • Centre Coordinates of Circle (X0, Y0) = (10, 10)
  • Radius of Circle = 10

 

Step-01:

 

Assign the starting point coordinates (X0, Y0) as-

  • X0 = 0
  • Y0 = R = 10

 

Step-02:

 

Calculate the value of initial decision parameter P0 as-

P0 = 3 – 2 x R

P0 = 3 – 2 x 10

P0 = -17

 

Step-03:

 

As Pinitial < 0, so case-01 is satisfied.

 

Thus,

  • Xk+1 = Xk + 1 = 0 + 1 = 1
  • Yk+1 = Yk = 10
  • Pk+1 = Pk + 4 x Xk+1 + 6 = -17 + (4 x 1) + 6 = -7

 

Step-04:

 

This step is applicable here as the given centre point coordinates is (10, 10).

 

Xplot = Xc + X0 = 1 + 10 = 11

Yplot = Yc + Y0 = 10 + 10 = 20

 

Step-05:

 

Step-03 and Step-04 are executed similarly until Xplot => Yplot as follows-

 

Pk Pk+1 (Xk+1, Yk+1) (Xplot, Yplot)
(0, 10) (10, 20)
-17 -7 (1, 10) (11, 20)
-7 7 (2, 10) (12, 20)
7 -7 (3, 9) (13, 19)
-7 15 (4, 9) (14, 19)
15 13 (5, 8) (15, 18)
13 19 (6, 7) (16, 17)
Algorithm Terminates

These are all points for Octant-1.

 

Algorithm calculates all the points of octant-1 and terminates.

Now, the points of octant-2 are obtained using the mirror effect by swapping X and Y coordinates.

 

Octant-1 Points Octant-2 Points
(10, 20) (17, 16)
(11, 20) (18, 15)
(12, 20) (19, 14)
(13, 19) (19, 13)
(14, 19) (20, 12)
(15, 18) (20, 11)
(16, 17) (20, 10)
These are all points for Quadrant-1.

 

Now, the points for rest of the part are generated by following the signs of other quadrants.

The other points can also be generated by calculating each octant separately.

 

Here, all the points have been generated with respect to quadrant-1-

 

Quadrant-1 (X,Y) Quadrant-2 (-X,Y) Quadrant-3 (-X,-Y) Quadrant-4 (X,-Y)
(10, 20) (10, 20) (10, 0) (10, 0)
(11, 20) (9, 20) (9, 0) (11, 0)
(12, 20) (8, 20) (8, 0) (12, 0)
(13, 19) (7, 19) (7, 1) (13, 1)
(14, 19) (6, 19) (6, 1) (14, 1)
(15, 18) (5, 18) (5, 2) (15, 2)
(16, 17) (4, 17) (4, 3) (16, 3)
(17, 16) (3, 16) (3, 4) (17, 4)
(18, 15) (2, 15) (2, 5) (18, 5)
(19, 14) (1, 14) (1, 6) (19, 6)
(19, 13) (1, 13) (1, 7) (19, 7)
(20, 12) (0, 12) (0, 8) (20, 8)
(20, 11) (0, 11) (0, 9) (20, 9)
(20, 10) (0, 10) (0, 10) (20, 10)
These are all points of the Circle.

 

Advantages of Bresenham Circle Drawing Algorithm-

 

The advantages of Bresenham Circle Drawing Algorithm are-

  • The entire algorithm is based on the simple equation of circle X2 + Y2 = R2.
  • It is easy to implement.

 

Disadvantages of Bresenham Circle Drawing Algorithm-

 

The disadvantages of Bresenham Circle Drawing Algorithm are-

  • Like Mid Point Algorithm, accuracy of the generating points is an issue in this algorithm.
  • This algorithm suffers when used to generate complex and high graphical images.
  • There is no significant enhancement with respect to performance.

 

To gain better understanding about Bresenham Circle Drawing Algorithm,

Watch this Video Lecture

 

Get more notes and other study material of Computer Graphics.

Watch video lectures by visiting our YouTube channel LearnVidFun.