🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #1278

Re: Algorithm for arc

#1278
From: Alastair Dallas
Date: Tue, 05 Feb 1991 21:00
22 lines
1441 bytes
In article <28315.27aabebc@kuhub.cc.ukans.edu>, heping@kuhub.cc.ukans.edu writes:
> I need algorithms for drawing arcs and ellipses, could someone help me?
> Thanks
> 
> Phil

When you interview for a programming job at Microsoft, they spring a pop
quiz on you.  One of the questions they asked me (years ago) was "design
an algorithm to draw an arc efficiently."  The answer they're looking 
for is something like Bresenham's algorithm which plots a point on the
arc { x = 0, y = r } and incrementally draws the arc by determining the
adjacent pixel with the least error.  My guess was scan-line by scan-line,
but this results in holes--a flood fill would "escape."

Bresenham's algorithm is described in "Fundamentals of Interactive
Computer Graphics," by Foley and Van Dam.  I see there's a new edition
out, but it's $60 or so--the good news is that the older edition should
now be even cheaper used.

Hope it helps.

/alastair/
Technical Details
Message-ID: <1991Feb5.210042.20045@dbase.A-T.COM>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!hacgate!ashtate!dbase!awd
References: <28315.27aabebc@kuhub.cc.ukans.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!hacgate!ashtate!dbase!awd
From: awd@dbase.A-T.COM (Alastair Dallas)
Newsgroups: comp.windows.ms.programmer
Subject: Re: Algorithm for arc
Summary: Bresenham
Message-ID: <1991Feb5.210042.20045@dbase.A-T.COM>
Date: 5 Feb 91 21:00:42 GMT
References: <28315.27aabebc@kuhub.cc.ukans.edu>
Organization: Ashton-Tate, Inc.
Lines: 22