Hi again,
Working with my real data and not with the little example i sent to the list i discovered that segm_distance function from package "pracma" does not converge to 0 in all cases, even if i increase the number of iteration to 10,000 for example. It seems that it depends on the "initialization" point - most like a minimization function.
So my thanks? go to Don who's suggestion works for the real data as well without any problems - so far ;-) He suggested to use the function crossing.psp from package "spatstat".
Thanks again to all who have answered and helped to solve my problem. I certainly learned few new things.
Monica
From: macqueen1 at llnl.gov
To: pisicandru at hotmail.com
CC: r-help at r-project.org
Date: Wed, 23 Nov 2011 14:03:42 -0800
Subject: Re: [R] x, y for point of intersection
The function crossing.psp() in the spatstat package might be of use.
Here's an excerpt from its help page:
crossing.psp package:spatstat R Documentation
Crossing Points of Two Line Segment PatternsDescription:
Finds any crossing points between two line segment patterns.
Usage:
crossing.psp(A,B)
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062