Conic Rotation Calculator – Rotate Axes to Eliminate xy Term
Many conic sections are written in the general quadratic form
\[
Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0.
\]
When the cross-term \(Bxy\) is present, the conic is rotated relative to the \(x\)- and \(y\)-axes.
A standard technique is to rotate the coordinate axes so that the new equation has no \(uv\) (cross) term.
1) Rotation of axes
Let \((u,v)\) be coordinates in a new system obtained by rotating the axes by an angle \(\theta\).
A common convention is:
\[
x = u\cos\theta - v\sin\theta,\qquad
y = u\sin\theta + v\cos\theta.
\]
Substituting these expressions into the original equation produces a new quadratic in \(u\) and \(v\):
\[
A'u^2 + B'uv + C'v^2 + D'u + E'v + F' = 0.
\]
This represents the same geometric curve—only the coordinate description changes.
2) Eliminating the \(uv\) (cross) term
The angle \(\theta\) that removes the cross term satisfies:
\[
\tan(2\theta)=\frac{B}{A-C}.
\]
Therefore,
\[
\theta = \frac12 \tan^{-1}\!\left(\frac{B}{A-C}\right).
\]
In practice, a numerically stable way to compute it is
\(\theta=\tfrac12\operatorname{atan2}(B,\ A-C)\), which handles cases like \(A\approx C\) correctly.
3) Rotated coefficients (key formulas)
Using the rotation substitution above, the quadratic coefficients become:
\[
A' = A\cos^2\theta + B\cos\theta\sin\theta + C\sin^2\theta
\]
\[
C' = A\sin^2\theta - B\cos\theta\sin\theta + C\cos^2\theta
\]
\[
B' = B\cos(2\theta) + (C-A)\sin(2\theta).
\]
If \(\theta\) is chosen by the elimination rule, then \(B'=0\) (up to numerical rounding).
The linear terms also rotate:
\[
D' = D\cos\theta + E\sin\theta,\qquad
E' = -D\sin\theta + E\cos\theta,\qquad
F'=F.
\]
(The constant term does not change under rotation alone.)
4) Conic type does not change under rotation
The discriminant
\[
\Delta = B^2 - 4AC
\]
is invariant under rotation. It classifies the conic (non-degenerate cases):
- \(\Delta < 0\): ellipse (circle is a special ellipse)
- \(\Delta = 0\): parabola
- \(\Delta > 0\): hyperbola
5) After rotation: completing the square (optional next step)
Once the cross term is removed, the rotated equation has the form
\[
A'u^2 + C'v^2 + D'u + E'v + F' = 0.
\]
Because there is no \(uv\) term, you can complete squares in \(u\) and \(v\) independently to find the
center (or vertex) and to rewrite the equation in a more standard-looking form.
Many tools (including this one) do this step to help with plotting and interpretation.
Example
Consider
\[
x^2 + xy + y^2 = 1
\quad\Longleftrightarrow\quad
x^2 + xy + y^2 - 1 = 0.
\]
Here \(A=1\), \(B=1\), \(C=1\). Since \(A-C=0\),
\[
\tan(2\theta)=\frac{1}{0}\ \Rightarrow\ 2\theta=90^\circ\ \Rightarrow\ \theta=45^\circ.
\]
After rotating by \(45^\circ\), the cross term disappears and the equation becomes an axis-aligned ellipse in \((u,v)\).