Quadratic Formula
Solves ax² + bx + c = 0 directly from the coefficients a, b and c.
x = (−b ± √(b² − 4ac)) ÷ 2a
D = b² − 4ac is the discriminant: D > 0 gives two real roots, D = 0 one repeated root, D < 0 no real roots.
The roots are the x-coordinates where the parabola y = ax² + bx + c crosses the x-axis.
Calculator
Change a value and the result and picture update instantly.
Result
Discriminant D
Root x₁
Root x₂
Animated picture
The picture follows your values. Some points and shapes can be dragged.
Use in game development
Solve a quadratic to find when a bullet hits a moving target, or where a ray hits a sphere in ray tracing.
Code example (JavaScript)
const D = b*b - 4*a*c;
if (D >= 0) { const t = (-b - Math.sqrt(D)) / (2*a); }
What the symbols mean
| Symbol | Meaning |
|---|---|
a | Coefficient a |
b | Coefficient b |
c | Coefficient c |
D | Discriminant D |
x1 | Root x₁ |
x2 | Root x₂ |
More formulas in this category
Frequently asked questions
- What is the formula for Quadratic Formula?
- The formula for Quadratic Formula is x = (−b ± √(b² − 4ac)) ÷ 2a. Solves ax² + bx + c = 0 directly from the coefficients a, b and c.
Math Formula Quiz Numbers, Algebra & Functions
Sources
Checked: 2026-11-29