R: Check Whether Segments Cross

test.crossing.psp {spatstat} | R Documentation

## Check Whether Segments Cross

### Description

Determine whether there is a crossing (intersection) between each pair of line segments.

### Usage

    test.crossing.psp(A, B)
    test.selfcrossing.psp(A)

### Arguments

`A,B` | Line segment patterns (objects of class `"psp"`).

### Details

These functions decide whether the given line segments intersect each other.

If `A` and `B` are two spatial patterns of line segments, `test.crossing.psp(A, B)` returns a logical matrix in which the entry on row `i`, column `j` is equal to `TRUE` if segment `A[i]` has an intersection with segment `B[j]`.

If `A` is a pattern of line segments, `test.selfcross.psp(A)` returns a symmetric logical matrix in which the entry on row `i`, column `j` is equal to `TRUE` if segment `A[i]` has an intersection with segment `A[j]`.

### Value

A logical matrix.

### Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.

### See Also

`psp`

### Examples

      B <- edges(letterR)
      A <- rpoisline(5, Frame(B))
      MA <- test.selfcrossing.psp(A)
      MAB <- test.crossing.psp(A, B)

[Package spatstat version 1.63-3 Index]