A program computing the Canonical Form.
We use the package Implicit Plot to plot all three Conics. We abbreviate the commands Coefficient and FS.
In[24]:=
We define the symmetric matrix A of degree 2 coefficients for a generic degree 2 polynomial f in the variables x, y.
In[27]:=
Defining colors, titles and comments.
Colors. We select the color for the original version of the Conic, for the rotated version, for the canonical version.
In[28]:=
Bold Characters. We define a function changing a text to be printed to boldface.
In[31]:=
We may now print into boldface a string s just by the command Print[s//BoldFace].
Titles. We define, for each section of the program, a macro printing the title of the section.
The first title introduces the original Conic.
In[32]:=
The second title introduces the rotation.
In[33]:=
The third title introduce the translation (the canonical form).
In[34]:=
The forth title introduces the graphics of the three Conics, and the color for each conic: for the original one, the rotated one, the canonical one.
In[35]:=
Comments. We introduce a few comments to be introduced in each section. The first comment introduces the matrix A.
In[36]:=
Here is a comment telling which kind of conic we have, according to the value of det(A).
In[37]:=
This comment introduces Eigenvalues and Eigenvectors.
In[38]:=
In[39]:=
Here is another comment, telling how many degrees we rotate the original Conic. The rotation is (x,y) |-> (x - y
, x
+ y
), hence the angle of rotation is ArcCos(
).
In[40]:=
Yet another comment, telling how far we translate the rotated Conic. The translation is (x,y)|->(x-a,y-b), therefore the distance is .
In[41]:=
This comment introduces the equation of the rotated Conic.
In[42]:=
This comment introduces the equation of the canonical form.
In[43]:=
Defining the program "Conic[f]".
Created by Mathematica (August 4, 2004)