philsupertramp/game-math
|
Go to the source code of this file.
Functions | |
Matrix< double > | forwardDiff (const Matrix< double > &x, const Matrix< double > &y) |
Matrix< double > | backwardDiff (const Matrix< double > &x, const Matrix< double > &y) |
Matrix< double > | centralDiff (const Matrix< double > &x, const Matrix< double > &y) |
Matrix< double > | backwardDiff2 (const Matrix< double > &x, const Matrix< double > &y) |
Matrix< double > | centralDiff4 (const Matrix< double > &x, const Matrix< double > &y) |
Numerical differentiation methods to approximate the first order derivative using support values.
$$f'(x) = ?$$
Implemented quotients:
Usage:
Computes backward difference quotient $$ f'(x) = \frac{f(x)-f(x-h)}{h} $$ Error O(dx)
x | x-values |
y | y-values @returnss approximated first differential evaluated on x-values |
Computes backward difference quotient for 1st differential uses 2nd order polynomial for approximation
Error O(dx)
x | x-values |
y | y-values @returnss approximated second differential evaluated on x-values |
Computes central difference quotient $$ f'(x) = \frac{f(x+h)-f(x-h)}{2h} $$ Error O(dx^2)
x | x-values |
y | y-values @returnss approximated first differential evaluated on x-values |
Computes central difference quotient for 1st differential uses 2nd order polynomial for approximation
Error O(dx^2)
x | x-values |
y | y-values @returnss approximated second differential evaluated on x-values |
Computes forward difference quotient $$ \frac{f(x+h)-f(x)}{h} $$ Error O(dx)
x | x-values |
y | y-values @returnss approximated differential evaluated on x-values |