cont.smooth: Smoothes a list or a matrix of $(x; y)$ coordinates.
Description
Applies a simple algorithm to smooth outlines, particularly to remove, if needed, digitalization artefacts.
Usage
cont.smooth(M, n)
Arguments
M
list or a matrix of $(x; y)$ coordinates to smooth
n
integer indicating how many smoothing iterations to perform
Value
A list of smoothed coordinates.
Details
The algorithm used is simplistic: the new $(x; y)_n$ coordinates are calculated as:
$$\frac{1}{4}\times(x; y)_{n-1} + \frac{1}{2}\times(x; y)_{n} + \frac{1}{4}\times(x; y)_{n+1}$$