comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Circle drawing request.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Circle drawing request. [message #7985 is a reply to message #7981] Tue, 28 January 1997 00:00 Go to previous message
Wayne Landsman is currently offline  Wayne Landsman
Messages: 117
Registered: January 1997
Senior Member
David Kennedy wrote:
>
> This must be a FAQ - anyone got a good circle drawing sub-routine?
> Input - x, y, radius
> Output - [x,y] vectors for POLYFILL etc.
>
> I have been using one (shown below) but I find it produces fine lines
> shooting off to small y values from the left and right edges of each
> circle. And my fiddling with it has made it worse I'm afraid.
>
David,

You might want to look at the procedure TVCIRCLE available from
http://idlastro.gsfc.nasa.gov/ftp/pro/tv/tvcircle.pro, which includes a
/FILL option for using POLYFILL. It uses a more sophisticated circle
drawing algorithm that was shown to me a few years back by Allyn Saroyn.

A possible problem with the simple-minded algorithm where the X,Y
coordinates of the circle are calculated at a preset number of values
(25*4 = 100 for David Fanning's sample code) is that the circle might
sometimes be smooth, and sometimes spiky, depending on the circle size
and the graphics device. TVCIRCLE gets around this problem by always
calculating the positions internally in device coordinates, and
calculating all positions where the X,Y device coordinates differ by an
integral amount. Thus, the circle is guarenteed (in principle) to come
out smooth on all graphics devices.

--Wayne Landsman landsman@mpb.gsfc.nasa.gov
[Message index]
 
Read Message
Read Message
Previous Topic: Shaded circles request.
Next Topic: Re: Colorbar query.

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 08:05:25 PDT 2025

Total time taken to generate the page: 1.04046 seconds