Re: Circle drawing request. [message #7975] |
Wed, 29 January 1997 00:00 |
Kevin Ivory
Messages: 71 Registered: January 1997
|
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.
Hi David,
I posted this one yesterday, but you may have missed it (I didn't
actually notice any flaw in the other one, but this is quite
straightforward - sorry I haven't commented it yet):
function circle, xcenter, ycenter, radius
a = (2*!pi/99.)*findgen(100)
x = xcenter + radius * cos(a)
y = ycenter + radius * sin(a)
return, transpose([[x],[y]])
end
Best regards
Kevin
--
Kevin Ivory Tel: +49 5556 979 434
Max-Planck-Institut fuer Aeronomie Fax: +49 5556 979 240
Postfach 20 mailto:kivory2@gwdg.de
D-37189 Katlenburg-Lindau, GERMANY http://www.gwdg.de/~kivory2/
|
|
|