home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.graphics
- Path: sparky!uunet!munnari.oz.au!hp9000.csc.cuhk.hk!cucs5.cs.cuhk.hk!hclam
- From: hclam@cuse1.se.cuhk.hk (LAM Ho Cheong)
- Subject: Re: How many dots in a circle?
- Message-ID: <1992Dec28.073738.15072@cucs5.cs.cuhk.hk>
- Sender: news@cucs5.cs.cuhk.hk
- Organization: Faculty of Engineering, The Chinese U. of Hong Kong
- References: <1992Dec22.134450.15558@cactus.org> <1992Dec23.031735.13264@proto.com>
- Date: Mon, 28 Dec 1992 07:37:38 GMT
- Lines: 28
-
- For each quadrant, the drawing algorithm should increment either in x
- or y direction one unit each time. As such, to move from the top-left
- corner to the bottom-right corner requires a total of r-1 + r-1 + 1 moves,
- where r is the radius. r-1 moves occur for the x direction and r-1
- moves occur for the y direction. So, adding the last dot gives a total
- of 2r-1. In fact, any arbritary line from the top-left to the bottom-right,
- not just for circle, requires the same number of points.
-
- For example, r = 5
-
- ***.. **...
- ..*.. .**..
- ..**. ..***
- ...*. ....*
- ...** or ....* or any other line
-
- a total of 9 *'s
-
- Therefore, for the whole circle, the total number of dots amounts to 8r-4
- with the same argument (4r-2 moves for each of x, y directions).
-
- Am I right?
-
-
- HC
- Computer Science Department
- The Chinese University of Hong Kong
-
-