Documentation ¶
Overview ¶
Package integrate provides functions to compute an integral given a specific list of evaluations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Trapezoidal ¶
Trapezoidal estimates the integral of a function f
\int_a^b f(x) dx
from a set of evaluations of the function using the trapezoidal rule. The trapezoidal rule makes piecewise linear approximations to the function, and estimates
\int_x[i]^x[i+1] f(x) dx
as
(x[i+1] - x[i]) * (f[i] + f[i+1])/2
where f[i] is the value of the function at x[i]. More details on the trapezoidal rule can be found at: https://en.wikipedia.org/wiki/Trapezoidal_rule
The (x,f) input data points must be sorted along x. One can use github.com/gonum/stat.SortWeighted to do that. The x and f slices must be of equal length and have length > 1.
Types ¶
This section is empty.