Finds any crossing points between two line segment patterns.
Line segment patterns (objects of class
Logical value indicating whether to return additional information. See below.
Logical value indicating what to do
if the windows of
This function finds any crossing points between
the line segment patterns
A crossing point occurs whenever one of the line segments in
intersects one of the line segments in
B, at a nonzero
angle of intersection.
The result is a point pattern consisting of all the intersection points.
details=TRUE, additional information is computed,
specifying where each intersection point came from.
The resulting point pattern has a data frame of marks, with columns
iA, jB, tA, tB. The marks
jB are the indices of the line segments in
B, respectively, which produced each intersection point.
tB are numbers between 0 and 1
specifying the position of the intersection point along the
If the windows
Window(B) do not
overlap, then an error will be reported if
fatal=FALSE an error will not occur
and the result will be
Point pattern (object of class
1 2 3 4 5 6 7
a <- psp(runif(10), runif(10), runif(10), runif(10), window=owin()) b <- psp(runif(10), runif(10), runif(10), runif(10), window=owin()) plot(a, col="green", main="crossing.psp") plot(b, add=TRUE, col="blue") P <- crossing.psp(a,b) plot(P, add=TRUE, col="red") as.data.frame(crossing.psp(a,b,details=TRUE))