R/convex.hull.R

Defines functions convex.hull

Documented in convex.hull

convex.hull<-function(tri.obj, plot.it=FALSE, add=FALSE,...)
{
  if(!inherits(tri.obj,"triSht"))
    stop("tri.obj must be of class \"triSht\"")

  ret<-list(x=tri.obj$x[tri.obj$chull],
            y=tri.obj$y[tri.obj$chull],
            i=tri.obj$chull)
  if(plot.it)
    {
      if (!add)
        {
          plot.new()
          plot.window(range(ret$x), range(ret$y), "")
        }
      lines(cbind(ret$x,ret$x[1]),cbind(ret$y,ret$y[1]), ...)
      invisible(ret)
    }
  else
    ret
}

Try the interp package in your browser

Any scripts or data that you put into this service are public.

interp documentation built on Nov. 28, 2023, 1:07 a.m.