Tina Cormier <tinaacorm...@gmail.com> wrote:

> I'd like to create a circle around each cluster that is
> the smallest circle that would encompass all 4 points.

The circumcircle.

Try the following:

<https://dl.dropboxusercontent.com/u/72421241/test_subplotsToPlots.zip><https://stat.ethz.ch/mailman/listinfo/r-sig-geo>library(spatstat)

circumcircle <- function(x, ...) {   UseMethod("circumcircle") }

circumcircle.owin <- function(x, ...) {
  d2 <- fardist(x, ..., squared=TRUE)
  z <- where.min(d2)
  r <- sqrt(min(d2))
  w <- disc(centre=z, radius=r)
  return(w)
}

circumcircle.ppp <- function(x, ...) {
  circumcircle(convexhull(x))
}


Adrian Baddeley

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to