Learn R Programming

polyCub (version 0.2-0)

polyCub.midpoint: Two-Dimensional Midpoint Rule

Description

The surface is converted to a binary pixel image using the as.im.function method from package spatstat. The integral under the surface is then approximated as the sum over (pixel area * f(pixel midpoint)).

Usage

polyCub.midpoint(polyregion, f, ..., eps = NULL,
    dimyx = NULL, plot = FALSE)

Arguments

polyregion
a polygonal integration domain. It can be any object coercible to the spatstat class "owin" (via as.owin).
f
two-dimensional function to be integrated. As its first argument the function must take a coordinate matrix, i.e. a numeric matrix with two columns.
...
further arguments for f.
eps
width and height of the pixels (squares), see as.mask.
dimyx
number of subdivisions in each dimension, see as.mask.
plot
logical indicating if an illustrative plot of the numerical integration should be produced.

Value

  • The approximated value of the integral of f over polyregion.

References

A. Baddeley and R. Turner (2005). Spatstat: an R package for analyzing spatial point patterns. Journal of Statistical Software 12 (6), 1-42.

See Also

Other polyCub.methods: polyCub, polyCub.exact.Gauss, polyCub.SV

Examples

Run this code
# see example(polyCub)

Run the code above in your browser using DataLab