mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
General mathematical utilities.
Classes | |
class | mx::math::histogramUniform< realT > |
A histogram with uniform bin spacing. More... | |
Functions | |
template<typename realT > | |
void | mx::math::quarticRoots (std::vector< std::complex< realT > > &x, realT a, realT b, realT c, realT d, realT e) |
Find the roots of the general quartic equation. More... | |
void mx::math::quarticRoots | ( | std::vector< std::complex< realT > > & | x, |
realT | a, | ||
realT | b, | ||
realT | c, | ||
realT | d, | ||
realT | e | ||
) |
Find the roots of the general quartic equation.
Finds the roots of
\[ f(x) = a x^4 + b x^3 + c x^2 + d x + e \]
using the general formula for quartic roots. See https://en.wikipedia.org/wiki/Quartic_function.
realT | is the floating point type used for calculations. |
[out] | x | On exit contains the 4 roots, is resized to length 4. |
[in] | a | the coefficient of the \(x^4\) term. |
[in] | b | the coefficient of the \(x^3\) term. |
[in] | c | the coefficient of the \(x^2\) term. |
[in] | d | the coefficient of the \(x^1\) term. |
[in] | e | the coefficient of the \(x^0\) term. |
Definition at line 129 of file roots.hpp.
References mx::astro::constants::c().
Referenced by mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::optimumTauWFS().