Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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,details=FALSE)

Arguments

A,B

Line segment patterns (objects of class "psp").

details

Logical value indicating whether to return additional information. See below.

fatal

Logical value indicating what to do if the windows of A and B do not overlap. See Details.

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.

The result is a point pattern consisting of all the intersection points.

If 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 named iA, jB, tA, tB. The marks iA and jB are the indices of the line segments in A and B, respectively, which produced each intersection point. The marks tA and tB are numbers between 0 and 1 specifying the position of the intersection point along the original segments.

If the windows Window(A) and Window(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.

Value

Point pattern (object of class "ppp").

Author(s)

See Also

Examples

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))

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.