12
This article was downloaded by: [University of Utah] On: 24 November 2014, At: 07:45 Publisher: Taylor & Francis Informa Ltd Registered in England and Wales Registered Number: 1072954 Registered office: Mortimer House, 37-41 Mortimer Street, London W1T 3JH, UK Journal of Graphics Tools Publication details, including instructions for authors and subscription information: http://www.tandfonline.com/loi/ujgt21 An Improved Circle Drawing Algorithm on a Hexagonal Grid Prabukumar Manoharan a & Bimal Kumar Ray a a School of Information Technology & Engineering (SITE), VIT University, Vellore, India Published online: 14 Apr 2014. To cite this article: Prabukumar Manoharan & Bimal Kumar Ray (2013) An Improved Circle Drawing Algorithm on a Hexagonal Grid, Journal of Graphics Tools, 17:1-2, 5-15, DOI: 10.1080/2165347X.2013.865004 To link to this article: http://dx.doi.org/10.1080/2165347X.2013.865004 PLEASE SCROLL DOWN FOR ARTICLE Taylor & Francis makes every effort to ensure the accuracy of all the information (the “Content”) contained in the publications on our platform. However, Taylor & Francis, our agents, and our licensors make no representations or warranties whatsoever as to the accuracy, completeness, or suitability for any purpose of the Content. Any opinions and views expressed in this publication are the opinions and views of the authors, and are not the views of or endorsed by Taylor & Francis. The accuracy of the Content should not be relied upon and should be independently verified with primary sources of information. Taylor and Francis shall not be liable for any losses, actions, claims, proceedings, demands, costs, expenses, damages, and other liabilities whatsoever or howsoever caused arising directly or indirectly in connection with, in relation to or arising out of the use of the Content. This article may be used for research, teaching, and private study purposes. Any substantial or systematic reproduction, redistribution, reselling, loan, sub-licensing, systematic supply, or distribution in any form to anyone is expressly forbidden. Terms & Conditions of access and use can be found at http:// www.tandfonline.com/page/terms-and-conditions

An Improved Circle Drawing Algorithm on a Hexagonal Grid

Embed Size (px)

Citation preview

Page 1: An Improved Circle Drawing Algorithm on a Hexagonal Grid

This article was downloaded by: [University of Utah]On: 24 November 2014, At: 07:45Publisher: Taylor & FrancisInforma Ltd Registered in England and Wales Registered Number: 1072954 Registered office: Mortimer House,37-41 Mortimer Street, London W1T 3JH, UK

Journal of Graphics ToolsPublication details, including instructions for authors and subscription information:http://www.tandfonline.com/loi/ujgt21

An Improved Circle Drawing Algorithm on a HexagonalGridPrabukumar Manoharana & Bimal Kumar Raya

a School of Information Technology & Engineering (SITE), VIT University, Vellore, IndiaPublished online: 14 Apr 2014.

To cite this article: Prabukumar Manoharan & Bimal Kumar Ray (2013) An Improved Circle Drawing Algorithm on a HexagonalGrid, Journal of Graphics Tools, 17:1-2, 5-15, DOI: 10.1080/2165347X.2013.865004

To link to this article: http://dx.doi.org/10.1080/2165347X.2013.865004

PLEASE SCROLL DOWN FOR ARTICLE

Taylor & Francis makes every effort to ensure the accuracy of all the information (the “Content”) containedin the publications on our platform. However, Taylor & Francis, our agents, and our licensors make norepresentations or warranties whatsoever as to the accuracy, completeness, or suitability for any purpose of theContent. Any opinions and views expressed in this publication are the opinions and views of the authors, andare not the views of or endorsed by Taylor & Francis. The accuracy of the Content should not be relied upon andshould be independently verified with primary sources of information. Taylor and Francis shall not be liable forany losses, actions, claims, proceedings, demands, costs, expenses, damages, and other liabilities whatsoeveror howsoever caused arising directly or indirectly in connection with, in relation to or arising out of the use ofthe Content.

This article may be used for research, teaching, and private study purposes. Any substantial or systematicreproduction, redistribution, reselling, loan, sub-licensing, systematic supply, or distribution in anyform to anyone is expressly forbidden. Terms & Conditions of access and use can be found at http://www.tandfonline.com/page/terms-and-conditions

Page 2: An Improved Circle Drawing Algorithm on a Hexagonal Grid

Journal of Graphics Tools, 17:5–15, 2013Copyright © Taylor & Francis Group, LLCISSN: 2165-347X print / 2165-3488 onlineDOI: 10.1080/2165347X.2013.865004

AN IMPROVED CIRCLE DRAWING ALGORITHM ON A HEXAGONAL GRID

Prabukumar Manoharan and Bimal Kumar Ray

School of Information Technology & Engineering (SITE), VIT University, Vellore, India

In this article, a double-step circle drawing algorithm on a hexagonal grid is presented.It chooses the best approximate pixels to the circle by setting additional pixels in loop itera-tions with only integer arithmetic. The performance of the proposed algorithm is found to bebetter than those of the existing algorithms.

1. INTRODUCTION

Circle drawing is a fundamental topic in thearea of computer graphics. To draw graphs andpictures, most of the graphics packages use acircle as an output primitive. Numerous algo-rithms have been proposed for rasterization ofcircles on the screen. The most famous circledrawing algorithm is presented by [Bresenham77]. Variations of Bresenham’s circle drawingalgorithm are published in [Kuzmin 90, McIlroy83, Liu 93a]. The other well-known midpointcircle drawing algorithm is presented by [Foleyet al. 1990]. The midpoint algorithm deter-mines pixel positions in a way similar to that inthe Bresenham’s circle drawing algorithm. Thechoice of the next pixel is determined by therelative position of the line with respect to themidpoint between the next two possible pix-els. A double-step circle drawing algorithm isproposed by [Wu and Rokne 87]. The speedof the algorithm is improved by selecting twopixels per iteration. However, in every iterationthe algorithm chooses only the second pixelusing a discriminator, the first pixel is chosenwithout using any discriminator. Therefore, theerror due to pixel selection is greater than halfa pixel for some pixels and this is not the bestapproximation to a circle. A double-step cir-cle drawing algorithm is presented by [Liu andLi 2007]. It uses only integer arithmetic for

Submitted July 24, 2013; Accepted November 8, 2013.Address correspondence to Prabukumar Manoharan, School of Information Technology & Engineering, VIT University, Vellore, 632

014, India. E-mail: [email protected]

choosing the best approximate pixels to drawa circle.

Hexagonal grid is one of the most importantgrids used in the digital geometry of computergraphics. This grid also falls within a feasi-ble domain on which many computer graph-ics rasterization algorithms can be successfullyimplemented. The related work is summarizedbelow.

An algorithmic comparison of the char-acteristics of digitized curves on square andhexagonal grids is presented by [Wuthrich andStucki 91]. Liu has developed an algorithm forthe generation of straight lines on a hexago-nal grid using only integer arithmetic [Liu 93c]and two algorithms that can generate circulararcs on a hexagonal grid by using just inte-ger arithmetic [Liu 93b]. A new approach forthe representation of a pixel in raster graph-ics is proposed by [Tytkowski 00]. [Tytkowski00] also discusses the advantages of a hexag-onal lattice over the conventional lattice. Theproperties and advantages of grids based onrhombic truncated octahedral tilings were givenin a study by [Miller 99]. Using a local countingalgorithm, better perimeter estimates may beobtained using a hexagonal or triangular grid.An approach was developed by [Ibáñez et al.01] to trace the lines in nonorthogonal grids ofany dimension using only additions. [Pitteway

5

Dow

nloa

ded

by [

Uni

vers

ity o

f U

tah]

at 0

7:45

24

Nov

embe

r 20

14

Page 3: An Improved Circle Drawing Algorithm on a Hexagonal Grid

6 THE JOURNAL OF GRAPHICS TOOLS

01] has presented an algorithm to draw conicsections on a hexagonal grid. The formula tocalculate the distance between two pixels ona hexagonal grid is developed by [Luczak andRosenfeld 76]. The idea of an improved mid-point circle drawing algorithm on a hexago-nal grid has been proposed by [Prabukumar11]. It achieves good performance for scan-converting a circle on a hexagonal grid. In thisstudy, we introduce a method for increasingthe speed of the circle algorithm on a hexag-onal grid by setting additional pixels in theloop iterations. It uses fewer calculations thanthe existing algorithms for choosing the bestapproximate pixels to draw a circle.

The rest of this article is organized as fol-lows. Section 2 gives a brief introduction tosquare and hexagonal sampling. In Section 3,the symmetric behavior of a circle is presented.Section 4 discusses the methodology of theproposed circle drawing algorithm. The per-formance analysis is presented in Section 5,and Section 6 contains the conclusion of thearticle.

2. SQUARE VERSUS HEXAGONALSAMPLING

The most common sampling techniquesused to sample the continuous function aresquare and hexagonal sampling. Let Ia(x, y) rep-resent a continuous function on the plane.To sample Ia(x, y) uniformly, it should be sam-pled at a regular interval. We use squaresampling in order to get the square-sampledfunction, which is defined by Ir(n1, n2) =Ia(n1�x, n2�y), where �x and �y are thehorizontal and the vertical sampling intervals,respectively, and (n1, n2) are the sampling coor-dinates of (x, y); see Figure 1. On the otherhand, the realization of the hexagonal sam-pling is obtained by shifting odd-numbered gridrows by �x/2 with respect to the even rows(Figure 2). In this case, the sample points alongthe row line up in the same manner as that forthe square sampling, whereas column pointsare alternately shifted. It may then be read-ily shown that the hexagonally sampled ver-sion of Ia is given by Ih(n1, n2) = Ia((1/2)(2n1 −n2)�x, n2�y).

FIGURE 1. Square sampling.

FIGURE 2. Hexagonal sampling.

The hexagonal sampling has certain impor-tant geometric features compared with thesquare sampling: the shape of a pixel is hexag-onal, the number of neighboring pixels is six,the minimum distance of neighboring pixelsfrom its center is one pixel, the maximum dis-tance of a neighboring pixel from its center isone pixel, the number of privileged directionsof the line display is three, and the anglebetween the privileged directions is 60 degrees.So the hexagonal sampling is a good choicefor developing a circle drawing algorithm on anonorthogonal grid.

3. CIRCLE SYMMETRY

The number of symmetric points generatedby four-fold and six-fold rotational symmetry of

Dow

nloa

ded

by [

Uni

vers

ity o

f U

tah]

at 0

7:45

24

Nov

embe

r 20

14

Page 4: An Improved Circle Drawing Algorithm on a Hexagonal Grid

MANOHARAN AND RAY: IMPROVED CIRCLE DRAWING ALGORITHM 7

(Y,-X)

(Y,-X)

(X,-Y)(-X,-Y)

(-Y,-X)

(-Y,X)

(-X,Y) (X,Y)

Y

X45°

FIGURE 3. Four-fold symmetry of a circle.

square and hexagonal grids, respectively, aredifferent. There is a 12-way symmetry con-sisting of six reflections, five rotations, and anidentity on a hexagonal grid, and an 8-waysymmetry consisting of four reflections, threerotations, and an identity on a square grid. Thissymmetric nature is illustrated in Figure 3 andFigure 4. A point at the location (x, y) on a1/8 sector of a circle is mapped to seven cir-cle points in the other octants of the xy plane ofa square grid, but on a hexagonal grid, a point(x, y) on a 1/12 sector of a circle is mappedthe 11 circle points in the other parts of thexy plane. The digital circles on a square grid

are axially symmetric with respect to two lineswith an angle of π/2 between them, as illus-trated in Figure 5. However, the digital circleson a hexagonal grid are axially symmetric withrespect to three lines with an angle of π/3between any two of them, as illustrated inFigure 6.

Because of symmetry, it is not neccessary tocompute all the pixels for drawing a circle. On asquare grid, only 1/8 of the entire circle needsto be generated, whereas on a hexagonal grid,it is only 1/12. This is why the computation of acircle drawing algorithm is reduced on a hexag-onal grid compared with that on a square grid.

Dow

nloa

ded

by [

Uni

vers

ity o

f U

tah]

at 0

7:45

24

Nov

embe

r 20

14

Page 5: An Improved Circle Drawing Algorithm on a Hexagonal Grid

8 THE JOURNAL OF GRAPHICS TOOLS

(U,-U-V) (V,-U-V)

(U+V, -V)

(U+V, -U)

(-U, U+V)(-V, U+V)

(-U-U, V)

(-U-V, U)

(-V,-U)

(-U,-V)

U30°

(V,U)

(U,V)

V

FIGURE 4. Six-fold symmetry of a circle.

FIGURE 5. Circle defined with four-fold symmetry. FIGURE 6. Circle defined with six-fold symmetry.

Dow

nloa

ded

by [

Uni

vers

ity o

f U

tah]

at 0

7:45

24

Nov

embe

r 20

14

Page 6: An Improved Circle Drawing Algorithm on a Hexagonal Grid

MANOHARAN AND RAY: IMPROVED CIRCLE DRAWING ALGORITHM 9

4. THE PROPOSED ALGORITHM FORCIRCLE DRAWING

The spatial relationship between an arbi-trary point (x, y) and a circle of radius r centeredat the origin is computed on a hexagonal gridusing the equation

f(x, y) =(√

3x2

)2

+(y+ x

2

)2 − r2. (1)

Let (x, y) be the current pixel of the circle with(0, r) as the coordinates of its initial point. Thenext two possible pixels are (x+ 1, y) and (x+1, y− 1), as shown in Figure 7. Now considerthe coordinates of the midpoint (called mp1 inFigure 7)

(x+ 1, y− 1

2

), half way between the

pixel (x+ 1, y) and (x+ 1, y− 1). The next pos-sible pixel is chosen based on the decisionparameter p determined by

p = f(

x+ 1, y− 12

)= 4

⎛⎝(√3

2(x+ 1)

)2

+(

y− 12+ 1

2(x+ 1)

)2

− r2

). (2)

The initial value of the decision param-eter is obtained by substituting the startingpoint (0, r) in Equation (2), which producesp = 3.

(x,y)

(mp1) (mp2)

(x+1,y)

(x+3,y-1)(x+1,y-1)

(x+2,y-2) (x+3,y-2)

(x+3,y-3)

(x+2,y-1)

(x+2,y) (x+3,y)

FIGURE 7. Choosing pixels.

Case 1: If p < 0, then the pixel (x+ 1, y) iscloser to a circular arc than the pixel (x+ 1,y− 1). The next possible pixel is either (x+ 2, y)or (x+ 2, y− 1). To determine which of the twopixels is closer to the circular arc, we shouldclassify whether the circular arc is above themidpoint between the two pixels (called mp2 inFigure 7). For the purpose of analysis the deci-sion parameter in Equation (2) is written interms of mp2, which is of the form

p = f(

x+ 1, y− 12

)

p = 4

⎛⎝(√3

2(x+ 2− 1)

)2

+(

y− 12+ 1

2(x+ 2− 1)

)2

− r2

).

(3)

p = 4(((

34

) ((x+ 2)2 + 1− 2 (x+ 2)

)2

+(

y− 12

)2

+ 14

(x+ 2− 1)

)2

+ 2(

y− 12

)(12

)(x+ 2− 1)− r2

). (4)

p = 4(((

34

) ((x+ 2)2 + 1− 2 (x+ 2)

)2

+(

y− 12

)2

+ 14((x+ 2)2 + 1− 2 (x+ 2)

))2

+ 2(

y− 12

)(12

)(x+ 2− 1)− r2

). (5)

p = 4

⎛⎝(√3

2(x+ 2)

)2

+(

y− 12+ 1

2(x+ 2)

)2

− r2

)

+ 3− 8 (x+ 2)+ 4− 4(

y− 12

). (6)

p = p− 8x− 4y− 10. (7)

Dow

nloa

ded

by [

Uni

vers

ity o

f U

tah]

at 0

7:45

24

Nov

embe

r 20

14

Page 7: An Improved Circle Drawing Algorithm on a Hexagonal Grid

10 THE JOURNAL OF GRAPHICS TOOLS

If the circular arc passes through mp2, thenthe decision parameter p is zero, in other

words,(√

32 (x+ 2)

)2 + (y− 12 + 1

2 (x+ 2))2 −

r2 = 0. The Equation (7) is changed to

p = −8x− 4y− 10. (8)

If the mp2 (Figure 7) is above the circulararc, then the pixel

(x+ 2, y

)is closer to the

circular arc than the pixel(x+ 2, y− 1

).

As a result, the equation(√

32 (x+ 2)

)2 +(y− 1

2 + 12 (x+ 2)

)2 − r2 < 0. Then theEquation (7) becomes p < −8x− 4y− 10.If the pixel

(x+ 2, y− 1

)is closer to the circu-

lar arc, then the decision parameter becomesp > −8x− 4y− 10. In order to reduce com-putational load,the value of p in each iterationmay be computed using the following recur-rence relation. If p < −8x− 4y− 10, thecurrent pixel is moved to

(x+ 2, y

).

pi+1 = 4

⎛⎝(√3

2(x+ 2+ 1)

)2

+(

y− 12+ 1

2(x+ 2+ 1)

)2

− r2

).

(9)

pi+1 = 4

⎛⎝(√3

2

)2 ((x+ 1)2 + 4+ 4 (x+ 1)

)

+(

y− 12+ 1

2(x+ 1+ 2)

)2

− r2

).

(10)

pi+1 = 4

⎛⎝(√3

2(x+ 1)

)2

+(

y− 12+ 1

2(x+ 1)

)2

− r2

)

+ 8x− 4y+ 18. (11)

pi+1 = pi + 8x− 4y+ 18. (12)

If p > −8x− 4y− 10, the current pixel ismoved to

(x+ 2, y− 1

)and the recurrence

relation may be computed in a similar way.

pi+1 = pi + 4x− 4y+ 17. (13)

Case 2: If p >= 0, a similar analysis shouldbe done. In this case, we determine whichof the two pixels, (x+ 2, y− 1) and (x+ 2,y− 2), is closer to the circular arc by eval-uating p < 4y− 4x− 10 for its truth value.If the pixel (x+ 2, y− 1) is closer to the circu-lar arc than the pixel (x+ 2, y− 2), then thecircular arc is above mp2 and (

√3

2 (x+ 2))2 +(y− 3

2 + 12 (x+ 2))2 − r2 < 0. Then the decision

parameter becomes p < 4y− 4x− 10. If thepixel (x+ 2, y− 2) is closer to the circular arcthan the pixel (x+ 2, y− 1), the circular arcis below the midpoint mp2, in other words,p > 4y− 4x− 10. A similar procedure may beused to reduce the calculation to computethe value of p in each iteration by comput-ing the recurrence formula. If p < 4y− 4x−10, the current pixel is moved to (x+ 2,y− 1). The updated decision parameter perthis condition is

pi+1 = 4

⎛⎝(√3

2(x+ 2+ 1)

)2

+(

y− 32+ 1

2(x+ 2+ 1)

)2

− r2

).

(14)

pi+1 = pi + 4x− 4y+ 17. (15)

If p > 4y− 4x− 10, the current pixel is movedto (x+ 2, y− 2). The updated decision param-eter per this condition is

Dow

nloa

ded

by [

Uni

vers

ity o

f U

tah]

at 0

7:45

24

Nov

embe

r 20

14

Page 8: An Improved Circle Drawing Algorithm on a Hexagonal Grid

MANOHARAN AND RAY: IMPROVED CIRCLE DRAWING ALGORITHM 11

pi+1 = 4

⎛⎝(√3

2(x+ 2+ 1)

)2

+(

y− 52+ 1

2(x+ 2+ 1)

)2

− r2

).

(16)

pi+1 = pi + 4x− 4y+ 18. (17)

To reduce the computational cost for comput-ing updated decision parameter p, we can usevariables M and N to hold the value−8x− 4y−10 and 4y− 4x− 10, respectively. By substitut-ing the initial pixel (0, r), the value of M andN is reduced to −4r− 10 and 4r− 10, respec-tively. The recurrence relation for p may alsobe simplified using M and N. With the aboveexpressions M and N, Case 1 and Case 2 aresimplified as detailed below and are respec-tively called “Case 1 (Simplified)” and “Case 2(Simplified).”

Case 1 (Simplified): If p < 0, the pixel tobe seleted is (x+ 2, y) and the updated deci-sion parameter, which is calculated by theEquation (12), in other words, pi+1 = pi + 8x−4y+ 18. This may be written as

pi+1 = pi − 2M+ 8. (18)

Mi+1 = Mi − 16. (19)

Ni+1 = Ni − 8. (20)

If the chosen pixel is (x+ 2, y− 1), then theupdated decision parameter in Equation (13)may be written as

pi+1 = pi + 4x− 4y+ 17 = pi −M− N+ 7.(21)

Mi+1 = Mi − 12. (22)

Ni+1 = Ni − 12. (23)

Case 2 (Simplified): If p >= 0, the chosenpixel is (x+ 2, y− 1), and the updated deci-sion parameter, which is calculated as given inEquation (16), in other words, pi+1 = pi + 4x−4y+ 17. This may be written as

pi+1 = pi −M− B+ 7. (24)

Mi+1 = Mi − 12. (25)

Ni+1 = Ni − 12. (26)

If the chosen pixel is (x+ 2, y− 2), then theupdated decision parameter in Equation (17)can be written as

pi+1 = pi + 4x− 4y+ 18 = pi − 2N+ 8.(27)

Mi+1 = Mi − 8. (28)

Ni+1 = Ni − 16. (29)

The pseudocode of the proposed algorithm ispresented in Algorithm 1.

Algorithm 1 Proposed Algorithm

Input:Radius RCenter (xc, yc) of the circle

Initialization:x← 0y← Rp← 3A←−4R− 10B← 4R− 10while x < y do

if p < 0 thenif p < A thenx← x+ 1;Setpixel(x, y);x← x+ 1;Setpixel(x, y);p← p− 2 ∗ A+ 8;A← A− 16;B← B− 8;

elsep← p− A− B+ 7;

Dow

nloa

ded

by [

Uni

vers

ity o

f U

tah]

at 0

7:45

24

Nov

embe

r 20

14

Page 9: An Improved Circle Drawing Algorithm on a Hexagonal Grid

12 THE JOURNAL OF GRAPHICS TOOLS

x← x+ 1;Setpixel(x, y);x← x+ 1;y← y− 1;Setpixel(x, y);A← A− 12;B← B− 12;

end ifelse if p < B then

p← p− A− B+ 7;x← x+ 1;Setpixel(x, y);x← x+ 1;y← y− 1;Setpixel(x, y);A← A− 12;B← B− 12;

elsep← p− 2B+ 8;x← x+ 1;y← y− 1;Setpixel(x, y);x← x+ 1;y← y− 1;Setpixel(x, y);A← A− 8;B← B− 16;

end ifend whilePlot the symmetry points

5. PERFORMANCE ANALYSIS

The performance of the proposed circledrawing algorithm on a hexagonal grid is com-pared with those of the existing circle draw-ing algorithms [Liu 93b, Prabukumar 11] on ahexagonal grid qualitatively and quantitatively.For qualitative comparison, circles of radii r =20, 25, 30, 35, and 40 are drawn and shownin Figure 8 through Figure 12 using the pro-posed algorithm, and the same is comparedwith those drawn using the existing algorithms.The hexagonal grid is an nonorthogonal gridand the square grid is an orthogonal grid,we are running the nonorthogonal grid cir-cle drawing algorithm on an orthogonal grid.So the circles in Figure 8 through Figure 12are are skewed. From these figures it may be

observed that the circles drawn using the pro-posed double-step algorithm exhibit less jaggies(Figure 11 specifically) than those obtained bythe existing algorithms. Thus, the quality of thedrawing obtained by the proposed algorithmis better than those obtained by the existingalgorithms.

The mean square error (MSE) and the max-imum error for circles drawn with differentradii are computed and compared with thoseproduced by the existing circle drawing algo-rithms on a hexagonal grid. The mean squareerror is the sum of squares of the differencesbetween the radius of the circle and the dis-tance between the center and a pixel on thecircle. The maximum error (MaxE) is the max-imum of the absolute differences between theradius of the circle and the distance betweenthe center and a pixel on the circle. If n is thenumber of pixels on a circle drawn with radiusr and d is the distance between the center andthe location of the ith pixel, then the MSE andMaxE are defined by

MSE =n∑

i=1

(R− di)2. (30)

MaxE = Maxi

(|R− di|). (31)

The MSE/MaxE (vertical) is shown graph-ically against the radius (horizontal) of circlein Figures 13 and 14. From these figures, weobserve that the MSE and MaxE produced bythe proposed algorithm are less compared tothe existing hexagonal grid algorithms. So thequality of the circle drawn by the proposedalgorithm is better than that drawn by exist-ing ones.

We also compare the execution time of theproposed algorithm with that of the existingalgorithms. The average execution time is cal-culated by executing the algorithm 500 times,measuring each execution time individuallyand then calculating the average of the exe-cution times of the 500 circles (Table 1). It isobserved from Table 1 that the average exe-cution time of the proposed algorithm is lessthan that required by other algorithms on ahexagonal grid.

Dow

nloa

ded

by [

Uni

vers

ity o

f U

tah]

at 0

7:45

24

Nov

embe

r 20

14

Page 10: An Improved Circle Drawing Algorithm on a Hexagonal Grid

MANOHARAN AND RAY: IMPROVED CIRCLE DRAWING ALGORITHM 13

(a) (b) (c) (d)

FIGURE 8. Circles with radius 20: (a) Circle 1, (b) Circle 2, (c) Circle 3, and (d) proposed.

(a) (b) (c) (d)

FIGURE 9. Circles with radius 25: (a) Circle 1, (b) Circle 2, (c) Circle 3, and (d) proposed.

(a) (b) (c) (d)

FIGURE 10. Circles with radius 30: (a) Circle 1, (b) Circle 2, (c) Circle 3, and (d) proposed.

(a) (b) (c) (d)

FIGURE 11. Circles with radius 35: (a) Circle 1, (b) Circle 2, (c) Circle 3, and (d) proposed.

Dow

nloa

ded

by [

Uni

vers

ity o

f U

tah]

at 0

7:45

24

Nov

embe

r 20

14

Page 11: An Improved Circle Drawing Algorithm on a Hexagonal Grid

14 THE JOURNAL OF GRAPHICS TOOLS

(a) (b) (c) (d)

FIGURE 12. Circles with radius 40: (a) Circle 1, (b) Circle 2, (c) Circle 3, and (d) proposed.

FIGURE 13. Mean square error for different radii.

FIGURE 14. Maximum error for different radii.

Dow

nloa

ded

by [

Uni

vers

ity o

f U

tah]

at 0

7:45

24

Nov

embe

r 20

14

Page 12: An Improved Circle Drawing Algorithm on a Hexagonal Grid

MANOHARAN AND RAY: IMPROVED CIRCLE DRAWING ALGORITHM 15

TABLE 1. Average execution time analysis

Circle Drawing Algorithm on Hexagonal Grid

Average Execution Time (microseconds)

Radius Circle 1 Circle 2 Circle 3 Proposed

5 11 7 4 0.2110 12 4 4 0.2225 13 6 5 0.4350 13 9 6 0.4475 13 10 6 1.54

100 13 11 7 2.20125 16 14 8 3.02

6. CONCLUSION

A double-step algorithm for drawing a circleon a hexagonal grid has been developed suc-cessfully. In contrast to the existing algorithms,the proposed algorithm selects two pixels periteration and thereby improves the perfor-mance of the algorithm two-fold over the exist-ing ones. The quality of drawing is also found tobe better than those produced by the existingalgorithms because of fewer jaggies.

ACKNOWLEDGMENTS

We would like to thank the anonymousreviewers and editors for their reviews andfeedback on the paper.

FUNDING

We thank VIT University, Vellore, India forsupporting this research work.

REFERENCES

[Bresenham 77] J. Bresenham. “A LinearAlgorithm for Incremental Digital Display ofCircular Arcs.” Communications of the ACM20 (1977), 100–106.

[Foley et al. 90] Foley, A. V. Dam, S.K. Feiner, and J. F. Hughes. ComputerGraphics Principles and Practice. Reading,MA: Addison-Wesley, 1990.

[Ibáñez et al. 01] L. Ibáñez, C. Hamitouche,and C. Roux. A Vectorial Algorithm forTracing Discrete Straight Lines in N-dimensional Generalized Grids. IEEE Trans.Vis. Comput. Graph, 7 (2001), 97–108.

[Kuzmin 90] Y. P. Kuzmin. “An Efficient Circle-Drawing Algorithm.” Computer GraphicsForum 9 (1990), 337–348.

[Liu 93a] Y. K. Liu. “Algorithm for CircleApproximation and Generation.” Computer-Aided Design, 25(1993a), 169–171.

[Liu 93b] Y. K. Liu. “The Generation of CircularArcs on Hexagonal Grids.” ComputerGraphics Forum 12 (1993b), 21–26.

[Liu 93c] Y. K. Liu. “The Generation of StraightLines on Hexagonal Grids.” ComputerGraphics Forum 12 (1993c), 27–32.

[Liu and Li 07] Y. K. Liu, and X. N. Li. “Double-Step Circle Drawing Algorithm with andWithout Grey Scale.” 4th Int. Con. on Imageand Graphics (2007), 886–891.

[Luczak and Rosenfeld 76] E. Luczak, and A.Rosenfeld. “Distance on a Hexagonal Grid.”IEEE Trans. Computer 25 (1976), 532–533.

[McIlroy 83] M. D. McIlroy. “Best ApproximateCircles on Inte-ger Grids.” ACM Transactionson Graphics 2(1983), 237–263.

[Miller 99] E. G. Miller. “Alternative Tilings forImproved Surface Area Estimates by LocalCounting Algorithms.” Computer Vision andImage Understanding 74(1999),193–211.

[Pitteway 01] M. L. V. Pitteway. “DrawingConics on a Hexagonal Grid.” In Proceedingsof the Fifth International Conference onInformation Visualization, pp. 489–491.

[Prabukumar 11] M. Prabukumar. “AnImproved Mid-Point Circle Drawing Algo-rithm on a Hexagonal Grid.” Journal ofAdvanced Research in Computer Science3(2011), 41–57.

[Tytkowski 00] K. T. Tytkowski. “HexagonalRaster for Computer Graphic.” In Proceed-ings of the IEEE International Conference onInformation Visualization, pp. 69–73.

[Wu and Rokne 87] X. Wu, and J. G. Rokne.“Double-step Incremental Generation ofLines and Circles.” CVGIP: Image Under-standing, 37(1987), 331–344.

[Wuthrich and Stucki 91] C. A. Wuthrich,and P. Stucki. “An Algorithmic ComparisonBetween Square- and Hexagonal-BasedGrids.” Computer Vision, Graphics, andImage Processing. Graphical Models andImage Processing 53 (1991), 324–339.

Dow

nloa

ded

by [

Uni

vers

ity o

f U

tah]

at 0

7:45

24

Nov

embe

r 20

14