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

Home » Public Forums » archive » Re: circles
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: circles [message #9500] Fri, 11 July 1997 00:00 Go to previous message
Kevin Reardon is currently offline  Kevin Reardon
Messages: 2
Registered: July 1995
Junior Member
lady of the elves wrote:
>
> I would really like to have a circularly-filled array; if anyone has
> better knowledge, please let me know :)
> Thanks.

The most direct way get an array of distances from some central point in IDL is:

;for a circle centered at (150,50)
xx = rebin(findgen(201,201) - 150,201,201)
yy = rebin(findgen(1,201) - 50,201,201)

radial_distance = sqrt(xx^2 - yy^2)

tvscl,radial_distance le 50 ; displays a white filled circular mask


The previous suggestion by Peter Suetterlin (pit@uni-sw.gwdg.de) of:
img = (shift(dist(X,Y),x0,y0)) LT R
doesn't seem to work if x0 and y0 are not equal to X/2 and Y/2 (i.e. the
circle is not centerted) because of wrapping problems when the array is shifted.

kevin
kreardon@na.astro.it
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: .Free Cash Grants
Next Topic: Are IDL functions callable from C++ programs under Win-NT

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

Current Time: Sat Oct 11 10:15:38 PDT 2025

Total time taken to generate the page: 1.83862 seconds