lineardisc(L, x = locator(1), r, plotit = TRUE,
cols=c("blue", "red","green")) countends(L, x = locator(1), r, toler=NULL)
"linnet")."ppp")
containing exactly 1 point, or a numeric vector of length 2.countends. See Details.
There is a sensible default.lineardisc is a list with two entries:"psp")
representing the interior disc"ppp")
representing the relative boundary of the disc.countends is an integer giving the number of
points in the relative boundary. The relative boundary of the disc $B(u,r)$
is the set of points $v$ such that the shortest path distance from
$x$ to $u$ is equal to $r$.
The function lineardisc computes the
disc of radius $r$ and its relative boundary,
optionally plots them, and returns them.
The faster function countends simply counts the number of
points in the relative boundary.
The optional threshold toler is used to suppress numerical
errors in countends.
If the distance from $u$ to a network vertex $v$
is between r-toler and r+toler, the vertex
will be treated as lying on the relative boundary.
linnetexample(linnet)
lineardisc(letterA, c(0,3), 1.6)
# count the endpoints
countends(letterA, c(0,3), 1.6)
# cross-check (slower)
lineardisc(letterA, c(0,3), 1.6, plotit=FALSE)$endpoints$nRun the code above in your browser using DataLab