Re: vector layer comparison in IDL [message #42857 is a reply to message #42824] |
Thu, 03 March 2005 14:42   |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
Mark Hadfield wrote:
> function magic_distance_function, x, y, x0, y0, x1, y1
>
> compile_opt DEFINT32
> compile_opt STRICTARR
> compile_opt STRICTARRSUBS
> compile_opt LOGICAL_PREDICATE
>
> d0 = sqrt((x-x0)^2+(y-y0)^2)
> d1 = sqrt((x-x1)^2+(y-y1)^2)
> dp = 2.0*poly_area([x,x0,x1],[y,y0,y1]) / $
> sqrt((x1-x0)^2+(y1-y0)^2)
>
> return, dp > (d0 < d1)
>
> end
Jim Pendleton of RSI has pointed out to me that there is an IDL function
called PNT_LINE that does this.
--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
|
|
|