Analytic geometry · Coordinate transformations

Affine Transformations and the Classification of Conics

The equation \(5x^2 + 4xy + 8y^2 - 32x - 56y + 80 = 0\) describes a perfectly ordinary ellipse, but you would never guess it: the ellipse is shifted and tilted, and the coordinate system is not adapted to it. This post is about changing coordinates so that the geometry becomes visible. We start with general (affine) coordinates and transformations, then use translation and rotation to bring any second-order curve to a simple standard form, and learn to tell what the curve is from two determinants, before doing any transformation at all.

1. Affine coordinates

Ordinary Cartesian coordinates use perpendicular axes with equal units. Affine coordinates drop both requirements: the axes can meet at any angle, and each axis has its own unit.

Definition (in space) Let \(O, E_1, E_2, E_3\) be four non-coplanar points. For a point \(M\), let \(M_1\) be the point where the plane through \(M\) parallel to the plane \(OE_2E_3\) meets the axis \(OE_1\); the points \(M_2\) on \(OE_2\) and \(M_3\) on \(OE_3\) are defined similarly. The affine coordinates of \(M\) are the (signed) ratios \[ x = \frac{OM_1}{OE_1}, \qquad y = \frac{OM_2}{OE_2}, \qquad z = \frac{OM_3}{OE_3}. \]

In vector language: \( \overrightarrow{OM} = x\,\overrightarrow{OE_1} + y\,\overrightarrow{OE_2} + z\,\overrightarrow{OE_3} \). The point \(O\) is the origin, and the segments \(OE_1, OE_2, OE_3\) are the units on the three axes. "Non-coplanar" guarantees that the three vectors form a basis, so every point gets exactly one triple \((x, y, z)\). Cartesian coordinates are the special case in which the vectors \(\overrightarrow{OE_i}\) are mutually perpendicular and of equal length.

O E₁ E₂ M M₁ M₂ x y
Figure 1. Affine coordinates in the plane. The axes \(OE_1\), \(OE_2\) are not perpendicular and have different units. The coordinates of \(M\) are read off by lines through \(M\) parallel to the axes: here \(x = OM_1/OE_1 = 3\), \(y = OM_2/OE_2 = 2\).

2. Affine transformations

Definition Transformations that, in some affine coordinate system, can be written as linear equations \[ \begin{aligned} x' &= a_1x + b_1y + c_1z + d_1,\\ y' &= a_2x + b_2y + c_2z + d_2,\\ z' &= a_3x + b_3y + c_3z + d_3,\end{aligned} \qquad \begin{vmatrix}a_1 & b_1 & c_1\\ a_2 & b_2 & c_2\\ a_3 & b_3 & c_3\end{vmatrix} \ne 0, \] where \((x, y, z)\) are the coordinates of a point \(M\) and \((x', y', z')\) those of its image \(M'\), are called affine transformations. If \(d_1 = d_2 = d_3 = 0\), they are linear transformations. Affine and linear transformations of the plane are the special case with two variables.

In matrix form, \( \mathbf r' = \mathbf A\,\mathbf r + \mathbf d \): a linear map followed by a shift. The condition \( \det\mathbf A \ne 0 \) means the map is invertible, so no dimension is lost (space is not squashed onto a plane or a line).

What affine maps preserve, and what they do not

PreservedNot preserved in general
straight lines and planeslengths
parallelismangles (a right angle may become oblique)
ratios of segments on one line (so midpoints, centroids)circles (they become ellipses)
ratios of areas / volumes (all scaled by \(|\det\mathbf A|\))areas and volumes themselves
Example 1 · The area of an ellipse, without integrals The linear map \( x' = ax \), \( y' = by \) (\(\det = ab\)) takes the unit circle \(x^2 + y^2 = 1\) to the ellipse \( \frac{x'^2}{a^2} + \frac{y'^2}{b^2} = 1 \). Areas are multiplied by \(|\det| = ab\), so the area of the ellipse is \( \pi\cdot ab \). (Compare with the parametric computation in the post on areas.)

3. Translation and rotation of axes

A transformation can be viewed in two ways: as moving the points (with the coordinate system fixed), or as moving the coordinate system (with the points fixed). Here we take the second view: the same point gets new coordinates \((x', y')\) in a new, still Cartesian, system.

Translation If the old system is translated so that its origin \(O\) moves to \(O_1(\alpha, \beta)\), the coordinates change by \[ x = x' + \alpha, \qquad y = y' + \beta. \]
Rotation If the old axes are rotated about the origin \(O\) through the angle \(\varphi\), \[ x = x'\cos\varphi - y'\sin\varphi, \qquad y = x'\sin\varphi + y'\cos\varphi. \]

Where the rotation formulas come from: the new unit vectors are \( \mathbf i' = (\cos\varphi, \sin\varphi) \) and \( \mathbf j' = (-\sin\varphi, \cos\varphi) \) in old coordinates. A point with new coordinates \((x', y')\) is \( x'\mathbf i' + y'\mathbf j' \), and its old coordinates are exactly the formulas above. Both transformations are affine, but special: they preserve lengths and angles (the matrix of the rotation is orthogonal, with determinant \(1\)), so a curve keeps its shape and size; only its equation changes.

4. Second-order curves and their classification

General equation \[ Ax^2 + 2Bxy + Cy^2 + 2Dx + 2Ey + F = 0 \tag{1} \] where \(A, B, C, D, E, F\) are constants (\(A, B, C\) not all zero) and \(x, y\) the coordinates of an arbitrary point of the curve.

The factors \(2\) in front of \(B, D, E\) are there to make the following determinants neat:

\[ \delta = \begin{vmatrix}A & B\\ B & C\end{vmatrix} = AC - B^2, \qquad \Delta = \begin{vmatrix}A & B & D\\ B & C & E\\ D & E & F\end{vmatrix}. \]

They are invariants: they have the same value after any translation and rotation of the axes. (So does \(A + C\).) This is what makes them useful: they describe the curve, not the coordinate system.

Classification of curves (1)
\(\Delta \ne 0\) (non-degenerate)\(\Delta = 0\) (degenerate)
\(\delta > 0\)ellipse (real or imaginary)a point (two imaginary lines meeting at a real point)
\(\delta < 0\)hyperbolapair of intersecting lines
\(\delta = 0\)parabolapair of parallel lines (real, coincident or imaginary)

How to read the table:

5. Curves with a centre (\(\delta \ne 0\))

The plan is to remove the linear terms by a translation to the centre, then the \(xy\)-term by a rotation. Write \( \Phi(x, y) \equiv Ax^2 + 2Bxy + Cy^2 + 2Dx + 2Ey + F \).

Step 1: translate to the centre

Centre If \(\delta \ne 0\), the curve (1) has a centre \(O_1(x_0, y_0)\), found from \[ \Phi'_x(x, y) = 0, \quad \Phi'_y(x, y) = 0, \qquad\text{i.e.}\qquad Ax + By + D = 0, \quad Bx + Cy + E = 0. \] Translating the origin to the centre, equation (1) becomes \[ Ax_1^2 + 2Bx_1y_1 + Cy_1^2 + F_1 = 0, \qquad F_1 = Dx_0 + Ey_0 + F = \frac{\Delta}{\delta}. \tag{2} \]

Why: substituting \( x = x_1 + x_0 \), \( y = y_1 + y_0 \), the new linear terms have coefficients \(2(Ax_0 + By_0 + D)\) and \(2(Bx_0 + Cy_0 + E)\), which are exactly zero at the centre. The quadratic part does not change, and the new constant is \( F_1 = \Phi(x_0, y_0) \). Since equation (2) contains only even powers, the curve is symmetric with respect to the new origin: that is what "centre" means. (The system has a unique solution because its determinant is \(\delta \ne 0\).)

Step 2: rotate the axes

Rotation to the principal axes Rotating the axes \(O_1x_1\), \(O_1y_1\) through a suitable angle \(\varphi\), equation (2) becomes \[ A_1X^2 + C_1Y^2 + F_1 = 0. \] The coefficients \(A_1\) and \(C_1\) are the roots of \[ \lambda^2 - (A + C)\lambda + \delta = 0, \] and the angle \(\varphi\) is found from \[ \tan 2\varphi = \frac{2B}{A - C} \qquad (\varphi = 45^\circ \text{ if } A = C). \]

Why these formulas: after the rotation, the coefficient of \(XY\) is \( 2B\cos 2\varphi - (A - C)\sin 2\varphi \); setting it to zero gives the angle. The invariants \(A + C\) and \(\delta = AC - B^2\) become \(A_1 + C_1\) and \(A_1C_1\), so \(A_1, C_1\) are the two numbers with this sum and product: the roots of the quadratic. (In linear-algebra language, they are the eigenvalues of the matrix \(\begin{pmatrix}A & B\\ B & C\end{pmatrix}\), and the new axes point along its eigenvectors.)

Which root is \(A_1\) depends on which of the possible angles you choose. To be sure, compute \( A_1 = A\cos^2\varphi + 2B\sin\varphi\cos\varphi + C\sin^2\varphi \) for the chosen \(\varphi\).

Example 2 · The tilted ellipse from the introduction \( 5x^2 + 4xy + 8y^2 - 32x - 56y + 80 = 0 \): \(A = 5\), \(B = 2\), \(C = 8\), \(D = -16\), \(E = -28\), \(F = 80\).
  1. Classify: \( \delta = 40 - 4 = 36 > 0 \), \( \Delta = -1296 \ne 0 \), and \( (A + C)\Delta < 0 \): a real ellipse.
  2. Centre: \( 5x + 2y - 16 = 0 \), \( 2x + 8y - 28 = 0 \) gives \( (x_0, y_0) = (2, 3) \). Then \( F_1 = -16\cdot 2 - 28\cdot 3 + 80 = -36 \), and indeed \( \frac{\Delta}{\delta} = \frac{-1296}{36} = -36 \). After translation: \( 5x_1^2 + 4x_1y_1 + 8y_1^2 - 36 = 0 \).
  3. Rotate: \( \lambda^2 - 13\lambda + 36 = 0 \) gives \(\lambda = 4, 9\). The angle: \( \tan 2\varphi = \frac{4}{-3} \); take \( \tan\varphi = 2 \) (\(\varphi \approx 63.4^\circ\)), which satisfies \( \frac{2\tan\varphi}{1 - \tan^2\varphi} = -\frac43 \). With \( \cos\varphi = \frac{1}{\sqrt5} \), \( \sin\varphi = \frac{2}{\sqrt5} \): \( A_1 = \frac{5 + 8 + 32}{5} = 9 \), so \( C_1 = 4 \).
  4. Result: \( 9X^2 + 4Y^2 = 36 \), that is \[ \frac{X^2}{4} + \frac{Y^2}{9} = 1: \] an ellipse with semi-axes \(2\) and \(3\), centred at \((2, 3)\), its major axis along the \(Y\)-axis.
x y O X Y φ O₁(2, 3)
Figure 2. The ellipse \(5x^2 + 4xy + 8y^2 - 32x - 56y + 80 = 0\). In the new system (origin at the centre \(O_1(2, 3)\), axes rotated by \(\varphi\) with \(\tan\varphi = 2\)), its equation is simply \( \frac{X^2}{4} + \frac{Y^2}{9} = 1 \).
Example 3 · \(xy = 1\) is a hyperbola \( A = C = 0 \), \( B = \frac12 \), \( F = -1 \): \( \delta = -\frac14 < 0 \), \( \Delta = \frac14 \ne 0 \): a hyperbola, with centre at the origin. Since \(A = C\), \(\varphi = 45^\circ\). The roots of \( \lambda^2 - \frac14 = 0 \) are \( \pm\frac12 \) (and with \(\varphi = 45^\circ\), \(A_1 = \frac12\)): \[ \frac12X^2 - \frac12Y^2 - 1 = 0, \qquad\text{i.e.}\qquad \frac{X^2}{2} - \frac{Y^2}{2} = 1. \] The familiar graph \(y = \frac1x\) is a rectangular hyperbola with semi-axes \(\sqrt2\), rotated by \(45^\circ\).

6. Curves without a centre (\(\delta = 0\))

If \(\delta = AC - B^2 = 0\), the quadratic part is a perfect square, \( Ax^2 + 2Bxy + Cy^2 = (\alpha x + \beta y)^2 \) (with \(\alpha^2 = A\), \(\alpha\beta = B\), \(\beta^2 = C\), after multiplying the equation by \(-1\) if needed). The system for the centre then has no unique solution, and the curve can be written as

\[ (\alpha x + \beta y)^2 + 2Dx + 2Ey + F = 0. \tag{3} \]

Two cases occur.

Case \(\beta_1\): \(D\) and \(E\) proportional to \(\alpha\) and \(\beta\)

If \( D = m\alpha \), \( E = m\beta \), the linear part also depends only on \( u = \alpha x + \beta y \), and (3) becomes

\[ (\alpha x + \beta y)^2 + 2m(\alpha x + \beta y) + F = 0, \]

a quadratic equation in \(u\). Hence

\[ \alpha x + \beta y = -m \pm\sqrt{m^2 - F}: \]

a pair of parallel lines (real if \(m^2 > F\), coincident if \(m^2 = F\), imaginary if \(m^2 < F\)).

Example 4 \( x^2 + 2xy + y^2 + 2x + 2y - 3 = 0 \): \( (x + y)^2 + 2(x + y) - 3 = 0 \), so \( \alpha = \beta = 1 \), \( m = 1 \), \( F = -3 \): \[ x + y = -1 \pm\sqrt{1 + 3} = -1 \pm 2: \qquad x + y = 1 \quad\text{and}\quad x + y = -3. \] Two parallel lines. (Check: \( (x + y - 1)(x + y + 3) = (x + y)^2 + 2(x + y) - 3 \).)

Case \(\beta_2\): \(D\) and \(E\) not proportional to \(\alpha\) and \(\beta\)

Then (3) can be written as

\[ (\alpha x + \beta y + n)^2 + 2m(\beta x - \alpha y + q) = 0, \tag{4} \]

where \(m, n, q\) are found by comparing coefficients of (3) and (4). The two expressions \( \alpha x + \beta y + n \) and \( \beta x - \alpha y + q \) define two perpendicular lines. Take them as the new axes: the line \( \alpha x + \beta y + n = 0 \) as the axis \(O_1X\) and \( \beta x - \alpha y + q = 0 \) as the axis \(O_1Y\). The new coordinates are the (signed) distances from these lines:

\[ X = \frac{\beta x - \alpha y + q}{\pm\sqrt{\alpha^2 + \beta^2}}, \qquad Y = \frac{\alpha x + \beta y + n}{\pm\sqrt{\alpha^2 + \beta^2}}. \]

Equation (4) then becomes

\[ Y^2 = 2pX, \qquad p = \frac{|m|}{\sqrt{\alpha^2 + \beta^2}}: \]

a parabola with vertex \(O_1\) (the intersection of the two lines) and axis \(O_1X\). The axis \(O_1X\) is oriented towards the half-plane in which \( \beta x - \alpha y + q \) has the sign opposite to the sign of \(m\). That is where the parabola lies, since by (4), \( m(\beta x - \alpha y + q) = -\frac12(\dots)^2 \le 0 \) on the curve.

Example 5 · A tilted parabola \( x^2 + 2xy + y^2 - 8x + 8y = 0 \): \( \delta = 1 - 1 = 0 \), \( (x + y)^2 - 8x + 8y = 0 \), \( \alpha = \beta = 1 \). Since \(D = -4\), \(E = 4\) are not proportional to \((1, 1)\), this is case \(\beta_2\).
Comparing \( (x + y + n)^2 + 2m(x - y + q) \) with \( (x + y)^2 - 8x + 8y \): the \(x\)- and \(y\)-coefficients give \( 2n + 2m = -8 \), \( 2n - 2m = 8 \), so \( n = 0 \), \( m = -4 \); the constant term gives \( n^2 + 2mq = 0 \), so \( q = 0 \): \[ (x + y)^2 - 8(x - y) = 0. \] With \( X = \frac{x - y}{\sqrt2} \), \( Y = \frac{x + y}{\sqrt2} \): \( Y^2 = 2pX \) with \( p = \frac{4}{\sqrt2} = 2\sqrt2 \). The vertex is the origin, the axis is the line \(x + y = 0\), and the parabola opens towards the side where \( x - y > 0 \) (sign opposite to \(m = -4\)).

7. Summary: the recipe

  1. Read off \(A, B, C, D, E, F\) (remember the factors \(2\) in (1)), compute \(\delta\) and \(\Delta\), and classify with the table.
  2. If \(\delta \ne 0\): find the centre from \( Ax + By + D = 0 \), \( Bx + Cy + E = 0 \); compute \( F_1 = \Delta/\delta \); find \(A_1, C_1\) from \( \lambda^2 - (A + C)\lambda + \delta = 0 \) and the angle from \( \tan 2\varphi = \frac{2B}{A - C} \). Result: \( A_1X^2 + C_1Y^2 + F_1 = 0 \).
  3. If \(\delta = 0\): write the quadratic part as \((\alpha x + \beta y)^2\). If \((D, E) = m(\alpha, \beta)\): parallel lines \( \alpha x + \beta y = -m \pm\sqrt{m^2 - F} \). Otherwise bring the equation to form (4) and read off the parabola \(Y^2 = 2pX\), \( p = \frac{|m|}{\sqrt{\alpha^2 + \beta^2}} \).
InvariantMeaning
\(\delta = AC - B^2\)type: ellipse (\(>0\)), hyperbola (\(<0\)), parabola (\(=0\)); \(\delta = A_1C_1\)
\(\Delta\)\(\Delta = 0\): degenerate (pair of lines or a point); for \(\delta \ne 0\), \(F_1 = \Delta/\delta\)
\(A + C\)\(= A_1 + C_1\); for an ellipse, real iff \((A + C)\Delta < 0\)

8. Practice problems

Try each one before opening the solution. More solved problems from this topic are in Geometry.

Problem 1: Classify \( x^2 - y^2 - 2x + 1 = 0 \).

\(A = 1, B = 0, C = -1, D = -1, E = 0, F = 1\). \( \delta = -1 < 0 \), and \( \Delta = 1\cdot(-1) - 0 + (-1)\cdot(0 - 1) = 0 \): a pair of intersecting lines. Indeed \( (x - 1)^2 = y^2 \), i.e. \( y = \pm(x - 1) \).

Problem 2: Classify \( x^2 + y^2 + 2x + 2 = 0 \).

\( \delta = 1 > 0 \), \( \Delta = 1\cdot 2 - 0 + 1\cdot(0 - 1) = 1 \ne 0 \), \( (A + C)\Delta = 2 > 0 \): an imaginary ellipse. Indeed \( (x + 1)^2 + y^2 = -1 \) has no real points.

Problem 3: Reduce \( 3x^2 + 2xy + 3y^2 - 8 = 0 \) to standard form.

Centre: the origin (\(D = E = 0\)), \(F_1 = -8\). \( \lambda^2 - 6\lambda + 8 = 0 \): \(\lambda = 2, 4\). \(A = C\), so \(\varphi = 45^\circ\), and \( A_1 = \frac{3 + 2 + 3}{2} = 4 \), \( C_1 = 2 \): \( 4X^2 + 2Y^2 = 8 \), i.e. \( \frac{X^2}{2} + \frac{Y^2}{4} = 1 \).

Problem 4: Find the centre of \( x^2 - 4xy + y^2 + 2x + 4y = 0 \) and classify it.

\(A = 1, B = -2, C = 1, D = 1, E = 2, F = 0\). \( \delta = 1 - 4 = -3 \). Centre: \( x - 2y + 1 = 0 \), \( -2x + y + 2 = 0 \): \( (x_0, y_0) = \big(\frac53, \frac43\big) \). \( F_1 = \frac53 + \frac83 = \frac{13}{3} \ne 0 \), so \(\Delta = \delta F_1 = -13 \ne 0\): a hyperbola. With \(\lambda^2 - 2\lambda - 3 = 0\): \(\lambda = 3, -1\); \(\varphi = 45^\circ\) gives \(A_1 = -1\), \(C_1 = 3\): \( -X^2 + 3Y^2 + \frac{13}{3} = 0 \).

Problem 5: Show that translation does not change \(A, B, C\) and changes \(D, E\) to \(Ax_0 + By_0 + D\), \(Bx_0 + Cy_0 + E\).

Substitute \( x = x_1 + x_0 \), \( y = y_1 + y_0 \) into (1). Quadratic terms in \(x_1, y_1\) come only from \(Ax^2 + 2Bxy + Cy^2\), with the same coefficients. The terms linear in \(x_1\) are \( 2Ax_0x_1 + 2By_0x_1 + 2Dx_1 = 2(Ax_0 + By_0 + D)x_1 \), and similarly for \(y_1\).

Problem 6: Under the affine map \(x' = x + y\), \(y' = y\), what happens to the unit square and to its area?

It becomes the parallelogram with vertices \((0, 0), (1, 0), (2, 1), (1, 1)\) (a shear). \(\det = 1\), so the area stays \(1\), although angles change.

Final thoughts

A second-order equation hides a simple curve behind an unsuitable coordinate system. Translation moves the origin to the centre and kills the linear terms; rotation aligns the axes with the curve and kills the \(xy\)-term. And before doing any of that, the invariants \(\delta\) and \(\Delta\) tell you what you will find. The broader lesson, the one affine geometry is built on, is that some properties (being a line, being parallel, being an ellipse) do not depend on the coordinates, while equations do. Choosing coordinates adapted to the object is half of solving a geometric problem.

Related posts: extrema in several variables (the same discriminant \(AC - B^2\)), vectors, and areas of plane figures.