6.5 Quadratic Forms; Orthogonal Diagonalization - Part 2
In-class demo by Russell Blyth
> restart: with(linalg): with(plots): with(plottools):
Warning, the protected names norm and trace have been redefined and unprotected
Warning, the name changecoords has been redefined
Warning, the name arrow has been redefined
Example 3: The quadric surface 2xy + z = 0
C is the matrix of the quadratic form
>
C := matrix(3,3,[[0,1,0],[1,0,0],[0,0,0]]);
Find the eigenvalues and eigenvectors of B
> evC := [eigenvectors(C)];
Normalize the eigenvectors:
>
u1 := normalize(evC[1][3][1]);
u2 := normalize(evC[2][3][1]);
u3 := normalize(evC[3][3][1]);
Construct a matrix P which orthogonally diagonalizes A
> PC := augment(u1,u2,u3);
Compute the diagonal matrix (since A = PD
, we have D =
AP)
> DC := evalm(transpose(PC) &* C &* PC);
Make Maple compute the equation of the rotated conic:
> LHSC := evalm(transpose([X,Y,Z]) &* DC &* [X,Y,Z]) + evalm(transpose([0,0,1]) &* PC &* [X,Y,Z]);
>
The equation is LHSC = 0, which is the equation of a hyperboloid of one sheet.
Let's graph, first the quadric surface relative to the new axes:
> implicitplot3d(x^2-z^2+y=0,x=-10..10,y=-10..10,z=-10..10,axes=normal,scaling=constrained,grid=[20,20,20]);
And then relative to the original axes: (the eigenspace basis vectors have been stretched to make them long enough to see clearly)
> u15 := evalm(5*u1); u25 := evalm(5*u2); u35 := evalm(5*u3);
>
u1g := line([0,0,0],convert(u15,list),color=red,thickness=4):
u2g := line([0,0,0],convert(u25,list),color=red,thickness=4):
u3g := line([0,0,0],convert(u35,list),color=red,thickness=4):
conicB := implicitplot3d(2*x*y + z = 0, x=-10..10,y=-10..10,z=-10..10,axes=normal,grid=[20,20,20]):
display([u1g,u2g,u3g,conicB],scaling=constrained);
>
>