## S3 method for class 'psp':
pairdist(X, \dots, method="Fortran", type="Hausdorff")
"psp"
)."Fortran"
and "interpreted"
.
Usually not specified."Hausdorff"
and "separation"
. Partial matching is used.[i,j]
entry is the distance
between the line segments numbered i
and j
.X
, and returns the matrix of distances.
This is a method for the generic function pairdist
for the class "psp"
.The distances between line segments are measured in one of two ways:
type="Hausdorff"
, distances are computed
in the Hausdorff metric. The Hausdorff
distance between two line segments is themaximumdistance
from any point on one of the segments to the nearest point on
the other segment.type="separation"
, distances are computed
as theminimumdistance from a point on one line segment to
a point on the other line segment. For example, line segments which
cross over each other have separation zero.method
is not normally used. It is
retained only for checking the validity of the software.
If method = "interpreted"
then the distances are
computed using interpreted R code only. If method="Fortran"
(the default) then Fortran code is used. The Fortran code is somewhat faster.crossdist
,
nndist
,
pairdist.ppp
L <- psp(runif(10), runif(10), runif(10), runif(10), owin())
D <- pairdist(L)
S <- pairdist(L, type="sep")
Run the code above in your browser using DataLab