[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*To*: Nick Bower <bowern(at)ses.curtin.edu.au>*Subject*: Re: generating symmetric array from function?*From*: "Liam E. Gumley" <Liam.Gumley(at)ssec.wisc.edu>*Date*: Mon, 11 Dec 2000 09:32:53 -0600*Newsgroups*: comp.lang.idl-pvwave*Organization*: Space Science and Engineering Center, UW-Madison*References*: <3A34E493.98E5428C@ses.curtin.edu.au>*Xref*: news.doit.wisc.edu comp.lang.idl-pvwave:22584

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

**References**:**generating symmetric array from function?***From:*Nick Bower

- Prev by Date:
**postscript file sizes** - Next by Date:
**Re: postscript file sizes** - Prev by thread:
**generating symmetric array from function?** - Next by thread:
**postscript file sizes** - Index(es):