Solve for x in a second-order polynomial such as ax^2 + bx + c = 0 using the quadratic formula.
x
ax^2 + bx + c = 0
The quadratic coefficient.
The linear coefficient.
The constant coefficient.
Returns the roots.
0.5.0
quadratic(1, 2, 1)// => [-1]quadratic(2, 4, -6)// => [1, -3]quadratic(1, 1, 1)// => [NaN, NaN] Copy
quadratic(1, 2, 1)// => [-1]quadratic(2, 4, -6)// => [1, -3]quadratic(1, 1, 1)// => [NaN, NaN]
Solve for
x
in a second-order polynomial such asax^2 + bx + c = 0
using the quadratic formula.