# integrate.box {voronoi}

Integral over a rectangular region
Package:
voronoi
Version:
1.1

### Description

Calculates the integral of a function over a rectangular region in the plane.

### Usage

```integrate.box(x.lims, y.lims, f = NULL, antideriv.x = NULL,
antideriv.y = NULL)
```

### Arguments

x.lims
A vector of length 2 describing the lower and upper limits of integration in the x-direction.
y.lims
A vector of length 2 describing the lower and upper limits of integration in the y-direction.
f
A function taking two arguments that is to be integrated over the specified region.
antideriv.x
A function taking two arguments that is the antiderivative of `f` with respect to x.
antideriv.y
A function taking two arguments that is the antiderivative of `f` with respect to y.

### Details

Only one of `f`, `antideriv.x`, or `antideriv.y` need be specified. Specification of either of the antiderivatives yields more efficient performance by reducing the dimension in which integration is performed.

### Values

The scalar result of the integration.

`centroidal`, `polygon.adapt`

### Examples

```func <- function(x, y) x + y^3
integrate.box(x.lims = c(0,4), y.lims = c(2,4), f = func)

antideriv.x <- function(x, y) x^2/2 + x*y^3
integrate.box(x.lims = c(0,4), y.lims = c(2,4), antideriv.x = antideriv.x)

antideriv.y <- function(x, y) x*y + y^4/4
integrate.box(x.lims = c(0,4), y.lims = c(2,4), antideriv.y = antideriv.y)```

### Author(s)

Travis A. Gerke

Documentation reproduced from package voronoi, version 1.1. License: GPL-3