I’m sure you’ve all seen the equation of a circle before:

You’ve probably also seen the equation of a hyperbola:

Or perhaps you’re more familliar with seeing the asymptotes at 45 degree angles to the co-ordinate axes, as in:
All these are special cases of the most general quadratic equation, which can be written in the following projective form:
Note that the
by
matrix in the middle is symmetric. As an example, the Family of circles centered at the origin, with radius
are associated to the family of matrices of the form:
The first form of the hyperbola, with asymptotes parallel to the co-ordinate axes, corresponds to the matrix:
![A_R = \left [ \begin{array}{ccc}<br />
0 & 1/\sqrt 2 & 0 \\ 1/\sqrt 2 & 0 & 0 \\ 0 & 1 & -1 \end{array} \right]](http://analogical-engine.com/wordpress/wp-content/cache/tex_e292dcf7ab54995fdcc7678eb0271611.png)
while the second hyperbola, with asymptotes at 45 degrees, corresponds to the matrix:
More generally, the matrix associated to a hyperbola whose axes have been tilded by an angle of
clockwise from the diagonal is:
The following mathematica code will let you play around with these rotations.
v = Transpose[{{x, y, 1}}];
similtude[A_, M_] := Transpose[M].A.M
equation[A_] := Solve[similtude[A, v][[1]][[1]] == 0, y]
R[theta_] := {{Cos[theta], -Sin[theta], 0},
{Sin[theta], Cos[theta], 0},
{0, 0, 1}};
H = {{1,0,0},{0,-1,0},{0,0,-1}}
W[theta_] := similtude[H, R[theta]]
Manipulate[
Plot[Evaluate[y /. equation[W[theta]]], {x, -4, 4},
PlotRange -> {{-4, 4}, {-4, 4}},
AspectRatio -> 1],
{{theta, 0}, -Pi, Pi}]
A few remarks about the code. In Mathematica square brackets are reserved for passing arguments into functions, curly brackets for defining lists, and normal round brackets for grouping terms in algebraic expressions.
Double square backets are used for indexing elements of a list. Matrices are represented as lists of list. The first list is the first row, the second list is the second row, etc…
The matrix multiplication operator is simply a dot. When defining your own functions, the variables which can be passed into a function must be followed by an underscore.
The built in functions, Transpose and Solve do more or less what you would expect. The only subtlety is that the output of Solve is a transformation rule. The /. notation replaces the left hand side with the right hand side in the transformation rule.
The built in function Plot is responnsible for drawing static plots. Leaving a parameter free (in this case the angle theta) and wrapping it inside the Manipulate command allows you to vary the parameter with the mouse and view the resulting animation.
Recall that translation can be thought of an operation in projective space represented by the matrix:
Now, starting from the matrix for a circle of radius one, centered at the origin:
![A = \left [ \begin{array}{ccc}<br />
1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & -1 \end{array} \right]](http://analogical-engine.com/wordpress/wp-content/cache/tex_d3a0b3c14e5e61a0a146fe70a7af0d65.png)
and applying the following similarity transform:
![= \left [ \begin{array}{ccc} 1 & 0 & -a \\<br />
0 & 1 & -b \\ -a & -b & -1+a^2+b^2 \end{array} \right]](http://analogical-engine.com/wordpress/wp-content/cache/tex_7b6226d4f321ac5e0fd692913b639312.png)
We obtain the matrix for a circle of radius one, centered at the point

. The following code will let you play around with this:
T[a_, b_] = {{1, 0, -a}, {0, 1, -b}, {0, 0, 1}};
CC = {{1,0,0},{0,1,0},{0,0,-1}}
M[a_, b_] := similtude[C, T[a, b]]
Manipulate[
Plot[Evaluate[y /. equation[CC]], {x, -2, 2},
PlotRange -> {{-2, 2}, {-2, 2}}, AspectRatio -> 1],
{{a, 0}, -1, 1}, {{b, 0}, -1, 1}]
Now for the fun part. Let us define the following “projective rotation”
Using this, we can smoothly deform a circle into a hyperbola. Check it out:
P[theta_] := {{Cos[theta], 0, -Sin[theta]}, {0, 1, 0},
{Sin[theta], 0, Cos[theta]}};
S[theta_] := similtude[CC, P[theta]]
Manipulate[
Plot[Evaluate[y /. equation[S[theta]]], {x, -10, 10},
PlotRange -> {{-10, 10}, {-10, 10}},
AspectRatio -> 1],
{{theta, 0}, -Pi, Pi}]
But what’s really going on here geometrically? The following three dimensional quadratic equation describes a mathematical cone (which is more like a pair of icecream cones, touching at their tips):
By setting
we are effectively taking the intersection with a plane. As you may know, all quadrics can be obtained by intersecting a cone with some given plane (hence the term conic section). The
plane gives a circle, while the
plane gives a hyperbola. Our “projective rotation” smoothly rotates the
axis to the
axis.