|
Gin
|
Numerical integration using the trapezoidal rule for discrete data points. More...
#include <gin_integrator.h>
Public Member Functions | |
| Integrator ()=default | |
| void | clear () |
| double | getIntegral () |
| void | addPoint (double x, double y) |
| void | addPoint (Point< double > point) |
| void | addPoints (juce::Array< Point< double > > points) |
Numerical integration using the trapezoidal rule for discrete data points.
Integrator calculates the definite integral of a function represented by a series of (x, y) data points using the trapezoidal rule. This is useful for computing areas under curves, cumulative sums, or any integration task where you have discrete data points rather than a continuous function.
The trapezoidal rule approximates the area between consecutive points as trapezoids, providing good accuracy for reasonably smooth data.
Key Features:
Important: Points must be added in increasing x order for correct results.
Usage:
|
default |
| void Integrator::clear | ( | ) |
| double Integrator::getIntegral | ( | ) |