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

Home » Public Forums » archive » Re: Problem with dist function in IDL
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: Problem with dist function in IDL [message #55659 is a reply to message #55301] Tue, 28 August 2007 11:26 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paolo_Grigis writes:

> This program (not optimized) reproduces the functionality of DIST:
>
> ---------------------
>
> n=4
> m=5
>
> a=dist(n,m)
> b=fltarr(n,m)
>
> FOR i=0L,n-1 DO BEGIN
> FOR j=0L,m-1 DO BEGIN
> i2=min([i,n-i])
> j2=min([j,m-j])
> b[i,j]=sqrt(i2^2+j2^2)
> ENDFOR
> ENDFOR

I was just having a look at the BUTTERWORTH filter code in the IDL
library, and I notice that the ITTVIS programmer who wrote this
function uses the double FOR loop method to create the distance
function, rather than DIST.

What do you suppose he knows that we don't!?

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
Previous Topic: controlling widget layout
Next Topic: xyouts for iPlot?

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

Current Time: Fri Oct 10 12:21:39 PDT 2025

Total time taken to generate the page: 1.28146 seconds