logo back up home forward   further reading more topics »

Maths - Eigenvectors and Eigenvalues of 2×2 Matrix

The method for symbolic computation of eigenvectors and eigenvalues involves first finding the eigenvalues from the characteristic polynomial:

det(M - λ I) = 0

where, in this case for two dimensional matrix M =

m00 m01
m10 m11

which gives the characteristic equation:

(m00 - λ)(m11 - λ) - m01 m10 = 0

expanding out gives:

λ² - (m00 + m11)λ + (m00 m11 - m01 m10) = 0

where:

solving the quadratic equation gives:

λ = (m00 + m11)/2 ± (√(4*m01*m10 + (m00 - m11)²))/2

We can then substitute these into

m00 - λ m01
m10 m11 - λ
=
0
0

which is equivalent to solving 2 simultaneous equations.

Special Cases

If the matrix is symmetrical around the leading diagonal:

m01=m10

then:

λ = (m00 + m11)/2 ± (√(2*m01)² + (m00 - m11)²))/2

Code

Here is a Java function to return the eigenvalues:

/**
code to return eigenvalues of a 2x2 matrix
result we be returned in resultReal[0],resultImaginary[0],resultReal[1] and resultImaginary[1]
expects arrays to be setup before being called, like this:
double[] resultReal= new double[2];
double[] resultImaginary = new double[2];
*/
public void eigenValue(double[][] m, double[] resultReal , double[] resultImaginary) {
  quadratic(1.0,m[0][0] + m[1][1],m[0][0]*m[1][1] - m[0][1]*m[1][0],resultReal,resultImaginary);
    // the quadratic function is defined on this page:
    // http://www.euclideanspace.com/maths/algebra/equations/polynomial/quadratic/
	return;
} 

metadata block
see also:

 

Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover Mathematics for 3D game Programming - Includes introduction to Vectors, Matrices, Transforms and Trigonometry. (But no euler angles or quaternions). Also includes ray tracing and some linear & rotational physics also collision detection (but not collision response).

Other Math Books

Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to the software project, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.

cover Mathmatica

Can you help?

Please send me any improvements to here. I would appreciate ideas to make the pages more useful including error correction, ideas for new pages, improvements to wording. It helps if you quote the full URL of the page.

 

Terminology and Notation

Specific to this page here:

 

program

I am working on a project which uses these principles, if you would like to help me with this you are welcome to join in, here:

http://sourceforge.net/projects/mjbworld/

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2008 Martin John Baker - All rights reserved - privacy policy.