This interactive visualization was created to explore quadratic forms and conic sections in ℝ². For any questions, information, or to report errors/typos, please contact me at riccardo_colletti@berkeley.edu.

Interactive Visualization — EECS 227A: Optimization Models in Engineering (Fall 2025), UC Berkeley.

Quadratic Forms in ℝ²

Interactive Visualization of Quadratic Forms and Conic Sections

Interactive Visualization

[
1.00 0.00
0.00 1.00
]
Matrix P (symmetric form)
Positive Definite - Ellipse
PD - Positive Definite
PSD - Positive Semidefinite
ND - Negative Definite
NSD - Negative Semidefinite
Indefinite - Mixed eigenvalues
1.00
0.00
0.00
1.00

Quadratic Forms in ℝ²

Consider a symmetric matrix:

\[ P = \begin{bmatrix} a & b \\ b & c \end{bmatrix} \in \mathbb{R}^{2 \times 2} \]

and the quadratic form:

\[ q(x,y) = \begin{bmatrix} x & y \end{bmatrix} P \begin{bmatrix} x \\ y \end{bmatrix} = ax^2 + 2bxy + cy^2 \]

The level sets $$\{(x,y) \in \mathbb{R}^2 : q(x,y) = 1\}$$ describe conic sections centered at the origin.

The possible cases are:

  • Ellipse (including circles): if $$P$$ is positive definite, i.e. all eigenvalues are strictly positive. In this case, $$q(x,y)$$ defines closed, bounded level sets.
  • Hyperbola: if $$P$$ is indefinite, i.e. $$P$$ has eigenvalues of opposite sign. Then the level sets are open curves extending to infinity.
  • Degenerate case (pair of parallel lines): if $$\det(P) = 0$$, so that $$P$$ has a zero eigenvalue. In this situation, the quadratic form vanishes along a line.
  • Negative definite: if both eigenvalues are negative, the set $$\{q(x,y) = 1\}$$ is empty (no real solutions).
Remark. A $$2 \times 2$$ quadratic form cannot generate a parabola. Parabolas require the presence of linear terms $$(Dx+Ey)$$ in the conic equation \[ Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0, \] which cannot be expressed using only a symmetric $$2 \times 2$$ matrix.