# S3 method for pp3
crosspairs(X, Y, rmax, what=c("all", "indices", "ijd"), ...)
Arguments
Value
A list with components i and j,
and possibly other components as described under Details.
Details
These are the efficient low-level functions used by spatstat
to find all close pairs of points in a three-dimensional point pattern
or all close pairs between two point patterns in three dimensions.
closepairs(X,rmax) identifies all pairs of neighbours
in the pattern X and returns them. The result is
a list with the following components:
i
Integer vector of indices of the first point in each pair.
j
Integer vector of indices of the second point in each pair.
xi,yi,zi
Coordinates of the first point in each pair.
xj,yj,zj
Coordinates of the second point in each pair.
dx
Equal to xj-xi
dy
Equal to yj-yi
dz
Equal to zj-zi
d
Euclidean distance between each pair of points.
If what="indices" then only the components i and
j are returned. This is slightly faster.
crosspairs(X,rmax) identifies all pairs of neighbours
(X[i], Y[j]) between the patterns X and Y,
and returns them. The result is
a list with the same format as for closepairs.
X <- pp3(runif(10), runif(10), runif(10), box3(c(0,1)))
Y <- pp3(runif(10), runif(10), runif(10), box3(c(0,1)))
a <- closepairs(X, 0.1)
b <- crosspairs(X, Y, 0.1)