R/outer.convex.hull.R

Defines functions outer.convhull

Documented in outer.convhull

outer.convhull<-function(cx,cy,px,py,FUN,duplicate="remove",...)
  {
    nx<-length(cx)
    ny<-length(cy)
    np<-length(px)
    if(length(py)!=np)
      stop("length of cx and cy differ")
    if (is.character(FUN))
      FUN <- get(FUN, mode = "function", inherits = TRUE)
    p.tr<-tri.mesh(px,py,duplicate)

    ans<-matrix(FUN(matrix(cx, nx, ny),
                    matrix(cy, nx, ny, byrow = TRUE),
                    ...), nx, ny)
    ans[!in.convex.hull(p.tr,matrix(cx, nx, ny),
                        matrix(cy, nx, ny, byrow = TRUE))]<-NA
    ans
  }

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.