/////////////////////////////////////////////////////////////////////// // // Find the real roots of a quadratic equation ax^2 + bx + c = 0 using the // method described in Numerical Recipes in Fortran, p. 178. // // Author: W. Heintzelman // // REVISION HISTORY: // 02/12/2014 : W. Heintzelman - New file // 21 Feb 2018 : W. Heintzelman - Provide for cases in which a=0 // //////////////////////////////////////////////////////////////////////// // x1 and x2 are set to zero and the function returns "false" if the // roots are imaginary or if both a and b are zero. // The function returns "true" otherwise. #ifndef __RAT_QuadraticRoots__ #define __RAT_QuadraticRoots__ namespace RAT { bool QuadraticRoots(double a,double b,double c,double& x1,double& x2); } // namespace RAT #endif