# lineardisc

##### Compute Disc of Given Radius in Linear Network

Computes the

- Keywords
- spatial

##### Usage

```
lineardisc(L, x = locator(1), r, plotit = TRUE,
cols=c("blue", "red","green"))
countends(L, x = locator(1), r)
```

##### Arguments

- L
- Linear network (object of class
`"linnet"`

). - x
- Location of centre of disc.
Either a point pattern (object of class
`"ppp"`

) containing exactly 1 point, or a numeric vector of length 2. - r
- Radius of disc.
- plotit
- Logical. Whether to plot the disc.
- cols
- Colours for plotting the disc. A numeric or character vector of length 3 specifying the colours of the disc centre, disc lines and disc endpoints respectively.

##### Details

The

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.

##### Value

- The value of
`lineardisc`

is a list with two entries: lines Line segment pattern (object of class `"psp"`

) representing the interior discendpoints Point pattern (object of class `"ppp"`

) representing the relative boundary of the disc.- The value of
`countends`

is an integer giving the number of points in the relative boundary.

##### References

Ang, Q.W. (2010)
*Statistical methodology for events on a network*.
Master's thesis, School of Mathematics and Statistics, University of
Western Australia.
Ang, Q.W., Baddeley, A. and Nair, G. (2012)
Geometrically corrected second-order analysis of
events on a linear network, with applications to
ecology and criminology.
To appear in *Scandinavian Journal of Statistics*.

##### See Also

##### Examples

```
example(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$n
```

*Documentation reproduced from package spatstat, version 1.25-1, License: GPL (>= 2)*