ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RealQuadradicEquation Struct Reference

#include <acts/blob/master/Core/include/Acts/Utilities/detail/RealQuadraticEquation.hpp>

Detailed Description

Mathematic struct for solving real quadratic equations

Mathematical motivation:
The equation is given by:
$ \alpha x^{2} + \beta x + \gamma = 0 $ and has therefore the analytical solution:
$ x_{1, 2} = - \frac{\beta \pm \sqrt{\beta^{2}-4\alpha\gamma}}{2\alpha}$

  • case $ \beta > 0 $:
    $ x_{1} = - \frac{\beta + \sqrt{\beta^{2}-4\alpha\gamma}}{2\alpha} := \frac{q}{\alpha}$,
    so that $ q= -\frac{1}{2}(\beta+sqrt{\beta^{2}-4\alpha\gamma})$. $ x_{2} $ can now be written as: $ x_{2} = \frac{\gamma}{q} = -\frac{2\gamma}{\beta+sqrt{\beta^{2}-4\alpha\gamma}}$, since:
    $ -\frac{2\gamma}{\beta+sqrt{\beta^{2}-4\alpha\gamma}} = -\frac{2\gamma}{\beta}\frac{1}{1+\sqrt{1-4\alpha\gamma/\beta^{2}}}$, and
    $ x_{2}\frac{1}{1-\sqrt{1-4\alpha\gamma/\beta^{2}}} = -\frac{2\gamma}{\beta}\frac{1}{1-1+4\alpha\gamma/\beta^{2}}=-\frac{\beta}{2\alpha}.$
    Hence, $ -\frac{\beta(1-\sqrt{1-4\alpha\gamma/\beta^{2}}}{2\alpha} = - \frac{\beta - \sqrt{\beta^{2}-4\alpha\gamma}}{2\alpha} $.
  • case $ \beta > 0 $ is similar.

The documentation for this struct was generated from the following file: