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

Home » Public Forums » archive » Re: Line index
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: Line index [message #5959 is a reply to message #5957] Fri, 22 March 1996 00:00 Go to previous messageGo to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
Hermann Mannstein <H.Mannstein@dlr.de> wrote:
>
> Hello,
> is there a robust function which returns the indices within an image
> (like the where function)
> belonging to a line defined by two or more points.

I don't have a function, but I can suggest a possible solution.
Given your two points, if you use the familiar Y = mX + B formula
to calculate the (X,Y) coordinate pairs for either each X or for
each Y along the "span" of the line (use the one that gives you
more points), and then convert these pairs to one-dimensional
indices using the formula

Indices = ( Y_coors * Xdim ) + X_coors

where the "image" is Xdim x Ydim. Obviously you'll have to do
some checking to make sure the points are within the image.

Hope this is useful.

Dave Foster
foster@bial1.ucsd.edu
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Fun Stuff: A widget map browser
Next Topic: Re: [Q]IDL: Using WHERE.

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

Current Time: Wed Oct 08 15:12:31 PDT 2025

Total time taken to generate the page: 0.00445 seconds