integral.tessfun | R Documentation |
Given a function which is constant on each tile of a tessellation, compute the integral of the function.
## S3 method for class 'tessfun'
integral(f, domain = NULL, ...)
f |
Integrand. A function of class |
domain |
Optional window (object of class |
... |
Ignored. |
The command integral
is generic.
This is the method for objects of class "tessfun"
.
The integrand f
should be a function of class
"tessfun"
created by as.function.tess
.
It represents a function which takes a constant value
on each tile of a tessellation.
The integral is calculated by multiplying the area of each tile by the value of the function in that tile, and summing. This avoids the need for discretisation and avoids concomitant discretisation errors.
A single numeric value.
.
as.function.tess
.
V <- dirichlet(runifrect(5))
f <- as.function(V, values=1/tile.areas(V))
integral(f) # should be close to 5.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.