Previous Up Next

5.58.2  Transform a matrix into a quadratic form: a2q

a2q takes two arguments: the symmetric matrix A of a quadratic form q and a vector of variable names of the same size.
a2q returns the symbolic expression of the quadratic form q.
Input:

a2q([[0,1],[1,0]],[x,y])

Output:

2*x*y

Input:

a2q([[1,2],[2,4]],[x,y])

Output:

x^2+4*x*y+4*y^2

Previous Up Next