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

Home » Public Forums » archive » Re: Is there a quick way to find the intersection of two lines?
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: Is there a quick way to find the intersection of two lines? [message #58607] Tue, 05 February 2008 06:00 Go to previous message
ben.bighair is currently offline  ben.bighair
Messages: 221
Registered: April 2007
Senior Member
On Feb 5, 3:24 am, eyuc...@gmail.com wrote:
> On Feb 4, 4:33 pm, "ben.bighair" <ben.bigh...@gmail.com> wrote:
>
>> On Feb 4, 7:08 pm, eyuc...@gmail.com wrote:
>
>>> Hi there,
>
>>> I have two sets of x-y data:
>>> x1=[1,2,3,4,5] y1=[3.2,7.4,8.2,9.3,7.9];
>>> x2=[1.2,1.4,2.3,2.8,3.3,3.9,4.1,4.5,5.2]
>>> y2=[3.1,5.2,6.2,7.3,7.5,8.6,9.6,8.7,7.4];
>
>>> By running:
>>> plot, x1, y1
>>> oplot, x2, y2
>>> we can clearly see that there are four intersections, but it is not
>>> clear what are the x,y coordinates of these points.
>
>>> Is there an easy way to do it? Thank you very much.
>
>> Hi,
>
> Thank you very much. I think I do understand how to find the
> intersection of two lines in principle, but actually doing it requires
> some details such as narrowing down the interval that the two lines
> intersect, counting intersection points, allocating memory to store
> the points and finally solving them.
>
> I just wonder if there are pre-made subroutines, since this is really
> a job we often do. If there are none, I'll try to make one...
>
>> You might want to check out Paul Bourke's great online tidbits about
>> geometry.
>
>> http://local.wasp.uwa.edu.au/~pbourke/geometry/
>
>> I have been chipping away at coding some of the algorithms he
>> describes into IDL, but have been easily sidetracked. You're welcome
>> to use what I have (mostly documented) as a starting point. My
>> implementations come with zero warranty...
>
>> www.tidewater.net/~pemaquid/pb.zip
>

Hi,

I think the routines you are looking for might be found in the pb.zip
collection I shared. You might need to work them in a sequence
testing each segment of polyline A against polyline B, but the
functions are all there.

Cheers,
Ben
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Confusion about the filter in time and frequency domain
Next Topic: Re: Confusion about the filter in time and frequency domain

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

Current Time: Wed Oct 08 19:12:52 PDT 2025

Total time taken to generate the page: 0.00404 seconds