The “distance map” of a set of points \(A\) is the function
  \(f\) whose value f(x) is defined for any two-dimensional
  location \(x\) as the shortest distance from \(x\) to \(A\).
This function computes the distance map of the set X
  and returns the distance map as a pixel image.
  
This is generic. Methods are provided for
  point patterns (distmap.ppp),
  line segment patterns  (distmap.psp)
  and windows (distmap.owin).