Identificiranje skupa svih rjesenja kvadratne jednadzbe

Elipsa (Pr. 17)

A={{2,1},{1,2}}; a={4,8};a0=-1;x={x1,x2};
f[x_]:=Simplify[A.x . x]+a . x+a0
Print[f[x],"=0"]
Print["A= ",MatrixForm[A],"  a= ",MatrixForm[a],"  a0=",a0]

Hiperbola (Pr. 20)

A={{5,3},{3,-3}}; a={6,2};a0=-1;x={x1,x2};
f[x_]:=Simplify[A.x . x]+a . x+a0
Print[f[x],"=0"]
Print["A= ",MatrixForm[A],"  a= ",MatrixForm[a],"  a0=",a0]

Parabola (Pr. 22)

A={{9,12},{12,16}}; a={50,-100};a0=25;x={x1,x2};
f[x_]:=Simplify[A.x . x]+a . x+a0
Print[f[x],"=0"]
Print["A= ",MatrixForm[A],"  a= ",MatrixForm[a],"  a0=",a0]

Degeneracija (Pr. 19)

A={{2,1},{1,2}}; a={2Sqrt[2],4Sqrt[2]};a0=5;x={x1,x2};
f[x_]:=Simplify[A.x . x]+a . x+a0
Print[f[x],"=0"]
Print["A= ",MatrixForm[A],"  a= ",MatrixForm[a],"  a0=",a0]

Dijagonalizacija

eigen=Eigensystem[A];
lam1=eigen[[1]][[1]];
lam2=eigen[[1]][[2]];
v1=eigen[[2,1]]/Norm[eigen[[2,1]]];
v2=eigen[[2,2]]/Norm[eigen[[2,2]]];
Print["lam1=",lam1,",  v1=",v1, ";   lam2=",lam2,",  v2=",v2];
y={y1,y2};
av={a . v1,a . v2 };
Print["a(v)=",av];
Print[(eigen[[1]] y) .  y+av . y+a0,"=0"];
Print["detA=",Det[A],",  gam=",av[[1]]^2/(4lam1)+av[[2]]^2/(4lam2)-a0];

Crtanje krivulje

(* Treba upisati samo novo ishodiste O1 i kontrolirati domenu crtanih pravaca i krivulje *)
O1={-Sqrt[2],-Sqrt[2]}; O1={-Sqrt[10]/6,0}; O1={1,0};O1={-1,-1};
{z1,z2}=={y[[1]]-O1[[1]],y[[2]]-O1[[2]]}
(* Veza starih i novih koordinata *)
OO1=O1[[1]] v1+O1[[2]] v2;
Print["OO1=",OO1];
{x1,x2}==OO1+z1 v1+z2 v2//Simplify
slk=ContourPlot[f[{xx,yy}]==0,{xx,-3,3},{yy,-4,3}];
slp=Plot[{(v1[[2]]/v1[[1]])(yy-OO1[[1]])+OO1[[2]], (v2[[2]]/v2[[1]])(yy-OO1[[1]])+OO1[[2]]},{yy,-5,5}];
Show[slk,slp]