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

Home » Public Forums » archive » Re: generating symmetric array from function?
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: generating symmetric array from function? [message #22780 is a reply to message #22777] Mon, 11 December 2000 07:32 Go to previous messageGo to previous message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
Nick Bower wrote:
>
> how do I generate symmetric 2D array from a function of one variable?
>
> eg. say i want the sinc function in 3 dimensions - how do i generate
> this symmetrically in both x and y dimensions?
>
> presumably, the last step would be a shift by N/2 in both x and y
> directions to move the origin to the centre of the array, but i'm just
> not sure what comes before this and how to do it without nested loops
> over the array elements.

v = findgen(41) * 0.5 - 10.0
x = rebin(v, 41, 41, /sample)
y = rebin(reform(v, 1, 41), 41, 41, /sample)
r = sqrt(x^2 + y^2) + 1.0e-6
z = sin(r) / r
surface, z, x, y

Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: CHANGING THE SIZE OF MOVIE WINDOW
Next Topic: IDLgrLegend broken

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

Current Time: Fri Oct 10 07:50:11 PDT 2025

Total time taken to generate the page: 6.63984 seconds