kill(all)$

maxima : comet approach the sun,problem:quadratic form,part 2 version 1.0
peter.vlasschaert@gmail.com,12/05/2022

ref:elementary linear algebra,prentice hall international editions ,C.H edwards,1988

my website:
maxima : comet approach the sun,problem:quadratic form,part 1 version 1.0

option :

ratprint:false;

quadratic form : pg 112
-------------------------------

given : f(x,y) = z1

data : ref : pg 112

z1:0.01413*x^2-0.01667*x*y+0.00926*y^2-0.04340*x-0.05787*y-0.07535=0;

real data : comet curve around the sun:ref : pg 112

z1a:2929*x^2-3456*x*y+1921*y^2-9000*x-12000*y-1526=0;

Q(x,y):

→ A, see : part 1

z2:matrix([2929,-3456.0/2],[-3456.0/2,1921.0]);

→ det(A)

z2a:determinant(z2);

→ eigenvalues: 

z4:eigenvalues(z2);

draw: λ[i], i=1,2, ref :fig 2,10,pg 112

z5a:[λ[1]=z4[1][1],λ[2]=z4[1][2]];

1e) step ;/25

z5b:[λ[1] =z4[1][1]/25,λ[2] =z4[1][2]/25];

2e) step:sqrt

z5c:[λ[1] =sqrt(z4[1][1]/25),λ[2] =sqrt(z4[1][2]/25)];

result : Q(x1,y1); Principal Axes for Quadratic Form 

z6a:Q(x1,y1)=λ[1]*x1^2+λ[2]*y1^2;
z6:subst(z5c,z6a);

→ eigenvectors

use :z2

z7:eivects(z2);

back : orginal coordinates :(x1,y1) →(x,y)

norm(xx):=sqrt(xx*xx);

a) transformation matrix : eigen vectors

z7a1:z7[2][1][1];

z7a1x:[z7a1[2],z7a1[1]];

z7aaa1:transpose(z7a1x);

z7a1a:1/sqrt((z7a1x[1])^2+(z7a1x[2])^2);

z7aa1:z7a1a*transpose(z7a1);

z7a2:z7[2][2][1];

z7a1y:[z7a2[2],z7a2[1]];

z7a1b:1/sqrt((z7a1y[1])^2+(z7a1y[2])^2);

z7aa2:z7a1b*transpose(z7a2);

convert : unit matrix

P = matrix ,columns ,unit eigenvectors

z8:addcol(z7aa1,z7aa2);

check : z8

determinant(z8);

z9:transpose([x1,y1]);

z9a:transpose([x,y]);

z9b:z9a=z8.z9;

diagonal :matrix: check 

z10:transpose(z8).z2.z8;

z11:expand(transpose(z9).z10.z9);

corrected : quadratic terms

z11a:%o26;

z11b:625*y1^2+4225*x1^2;

linear terms

z12:B=expand([-9000,-1200].rhs(z9b));

constant term :

z13:1521;

final equation :

z14:z11b+rhs(z12)+z13=0;

rotation angle : θ

z15:matrix([cos(θ),sin(θ)],[-sin(θ),cos(θ)]);

relation : P matrix & rotation matrix
use :z8

z15a:map("=",args(z8),args(z15));

z15b:map("=",lhs(z15a[1]),rhs(z15a[1]));

→sin(θ)

z15b1:float(solve(z15b[2],θ))*180/3.14159;