Matrix diagonalization
Return
to the Math APIs page.
Background:
If a
square matrix (
A), a number (λ), and a
vector (
v) are related by the equation
Av = λ
v, then λ and
v are said to be an
eigenvalue and eigenvector respectively of
A. An
n x
n matrix that is
symmetric (like most of significance and like the example below) has
n eigenvalues, each corresponding to an eigenvector that points in a direction perpendicular to the other (
n - 1) eigenvectors. Many calculations involving a matrix can be done easily - if at all - only after first calculating its eigenvectors and eigenvalues, a process often called
diagonalization. This API diagonalizes matrices using the
Jacobi method.
Instructions:
After the url above you should type
/ followed by a comma-separated list of the
column vectors, none of which includes elements in the
lower-triangular portion of the matrix. Each column vector is a parenthesis-wrapped comma-separated list of numbers. If you want the results in json instead of html, snuggle
/api immediately after
...heroku.com
Example:
The matrix depicted below is specified for this API by the url
...heroku.com/(1),(2,3),(4,5,6)
Note that the last number (1, 3, or 6) in each column vector is along the matrix's
diagonal.
1.0 |
2.0 |
4.0 |
2.0 |
3.0 |
5.0 |
4.0 |
5.0 |
6.0 |
The eigenvalues for this particular matrix are approximately -0.057, -1.507, and 11.564.
Here are some unrelated webpages that also calculate eigenvalues and eigenvectors:
creator:
Peter Knipp
repo:
https://github.com/pknipp/eigen