spatstat (version 1.36-0)

crossing.psp: Crossing Points of Two Line Segment Patterns

Description

Finds any crossing points between two line segment patterns.

Usage

crossing.psp(A,B,fatal=TRUE)

Arguments

A,B
Line segment patterns (objects of class "psp").
fatal
Logical value indicating what to do if the windows of A and B do not overlap. See Details.

Value

  • Point pattern (object of class "ppp").

Details

This function finds any crossing points between the line segment patterns A and B.

A crossing point occurs whenever one of the line segments in A intersects one of the line segments in B, at a nonzero angle of intersection.

If the windows as.owin(A) and as.owin(B) do not overlap, then an error will be reported if fatal=TRUE, while if fatal=FALSE an error will not occur and the result will be NULL.

See Also

selfcrossing.psp, psp.object, ppp.object.

Examples

Run this code
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")

Run the code above in your browser using DataCamp Workspace