R/area.xypolygon.R

area.xypolygon <-
function (polly) {
    xp <- polly[,1]
    yp <- polly[,2]
    nedges <- length(xp)
    yp <- yp - min(yp)
    nxt <- c(2:nedges, 1)
    dx <- xp[nxt] - xp
    ym <- (yp + yp[nxt])/2
    sum(dx * ym)
}

Try the rareNMtests package in your browser

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

rareNMtests documentation built on June 7, 2022, 5:10 p.m.