This is a method for the generic function pairdist
. Given a three-dimensional point pattern X
(an object of class "pp3"
),
this function computes the Euclidean distances between all pairs of
points in X
, and returns the matrix of distances.
Alternatively if periodic=TRUE
and the window containing X
is a
box, then the distances will be computed in the `periodic'
sense (also known as `torus' distance): opposite faces of the
box are regarded as equivalent.
This is meaningless if the window is not a box.
If squared=TRUE
then the squared Euclidean distances
$d^2$ are returned, instead of the Euclidean distances $d$.
The squared distances are faster to calculate, and are sufficient for
many purposes (such as finding the nearest neighbour of a point).