# Question:Reducing parabola with LinearAlgegra

## Question:Reducing parabola with LinearAlgegra

Maple 2021

how to transform this program using LinearAlgebra instead of linalg  ?

restart;
with(plots);
unprotect(gamma, D);
interface(rtablesize = 10): _EnvHorizontalName := 'x': _EnvVerticalName := 'y':
f := (x, y) -> 4*x^2 + 4*y*x + y^2 - 8*x + 16*y - 17: (for instance)
NULL;
Fg := proc(P::polynom, v::set, V::list, N::list)
local C, M, i, j;
C := coeffs(f(x, y), v, M); seq(`if`(member(op(i, [M]), N, 'j'), op(j, V) = op(i, [C]), NULL), i = 1 .. nops([M])); end proc:
Fg(f(x, y), {x, y}, [A, B, C, D, E, F], [x^2, y*x, y^2, x, y, 1]):
assign(%);
Delta := -4*A*C + B^2:
var := [x, y]:
with(linalg):
AA := matrix([seq([seq(diff(f(x, y), var[i], var[j])/2, j = 1 .. 2)], i = 1 .. 2)]):
vp := sort([eigenvals(AA)]):
print(`Valeur propres de AA ` = vp):
DD := jordan(AA, 'P11'):
print(`Matrice diagonale semblable à AA:   DD` = evalm(DD)):
G := map(normalize, GramSchmidt([col(P11, 1 .. 2)])):
PP := map(simplify, concat(op(G))):
print(`Matrice de passage orthogonale:   PP` = evalm(PP)):
print(`Directions principales de la conique:`):
print(`I1 ` = col(PP, 1), ` J ` = col(PP, 2)):
alpha := 1/2*arctan(B/(A - C)):
print('alpha' = evalf(%)):

M1 := matrix(1, 2, [X, Y]):
M2 := matrix(2, 1, [X, Y]):
multiply(M1, AA, M2):
N := matrix(1, 2, [D, E]):
multiply(M1, AA, M2) + multiply(N, M2):
multiply(M1, transpose(PP), AA, PP, M2) + multiply(N, PP, M2):

NULL;
The parabola in the new base is Y`^2 =X*(8*sqrt(5))/5 , <sqrt(5), -2*sqrt(5)>, <sqrt(5), 2*sqrt(5)>

﻿