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

Home » Public Forums » archive » Re: making a circle of certain values
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: making a circle of certain values [message #56123 is a reply to message #56122] Tue, 02 October 2007 08:43 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Loren Anderson writes:

> I'm not sure if this is what you need, but here are the guts of the
> tvcircle routine that David suggested:
>
> FUNCTION Circle, radius, xcenter, ycenter, NPoints=NPoints
> ; Returns the x and y values of a circle
>
> IF N_Elements(NPoints) EQ 0 THEN NPoints=100
>
> seeds = Findgen(npoints)/(npoints-1)*2*!pi
> xvals = sin(seeds)*radius+xcenter
> yvals = cos(seeds)*radius+ycenter
>
> RETURN, Transpose([[xvals], [yvals]])
> END

What is different about TVCIRCLE, however, is that it
*always* produces circles on a plot, as opposed to this
code, which might well produce ellipses if you have the
plot aspect ratio as something other than 1:1.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: SetPixelData Error
Next Topic: label x axis

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

Current Time: Sat Oct 11 20:41:46 PDT 2025

Total time taken to generate the page: 1.61740 seconds