PHP classes for working with, and solving, quadratic equations.
This is a work in progress to share and update some PHP I wrote to solve quadratic equations. The code in solver.php is from 2004 - very procedural, no classes, no namespaces, no composer etc. The plan is to update this code to fix all that, with a Gamajo\Quadratic\Equation class and a Gamajo\Quadratic\Solver class.
A quadratic equation is a univariate polynomial with degree of 2, that is then set to equal zero so that the indeterminate can be determined:
ax2 + bx + c = 0
Equations can often be solved with factoring or completing the square, but there is also a Quadratic Formula:
The function in solver.php accepts values for a, b and c and returns one or both roots if they could be determined.