logo back up home forward   further reading more topics »

Maths - Matrix algebra - 3D arithmatic

The following calculator allows you to calculate 3x3 matrix arithmetic. Enter the values into the matrix into the top two matries and then press "+ - or * " to display the result in the bottom matrix:

 

 

=

Matrix Addition

To add matrices just add the corresponding elements, so for 3x3 matrices and then,

a00 + b00 a01 + b01 a02 + b02
a10 + b10 a11 + b11 a12 + b12
a20 + b20 a21 + b21 a22 + b22
=
a00 a01 a02
a10 a11 a12
a20 a21 a22
+
b00 b01 b02
b10 b11 b12
b20 b21 b22

Matrix Subtraction

To subtract matrices just subtract the corresponding elements, so for 3x3 matrices and then,

a00 - b00 a01 - b01 a02 - b02
a10 - b10 a11 - b11 a12 - b12
a20 - b20 a21 - b21 a22 - b22
=
a00 a01 a02
a10 a11 a12
a20 a21 a22
-
b00 b01 b02
b10 b11 b12
b20 b21 b22

Matrix Multiplication

The multiplication of two 3x3 matrices is:

a00*b00 + a01*b10 + a02*b20 a00*b01 + a01*b11 + a02*b21 a00*b02 + a01*b12 + a02*b22
a10*b00+ a11*b10 + a12*b20 a10*b01 + a11*b11 + a12*b21 a10*b02 + a11*b12 + a12*b22
a20*b00 + a21*b10 + a22*b20 a20*b01 + a21*b11 + a22*b21 a20*b02 + a21*b12 + a22*b22
=
a00 a01 a02
a10 a11 a12
a20 a21 a22
b00 b01 b02
b10 b11 b12
b20 b21 b22

This is worked out as follows: for each entry in the matrix we take the row from the first operand and the column from the second operand:

a00 a01 a02
a10 a11 a12
a20 a21 a22
b00 b01 b02
b10 b11 b12
b20 b21 b22
=
a00
a10
a20
b00 b01 b02
a01
a11
a21
b00 b01 b02
a02
a12
a22
b00 b01 b02
a00
a10
a20
b10 b11 b12
a01
a11
a21
b10 b11 b12
a02
a12
a22
b10 b11 b12
a00
a10
a20
b20 b21 b22
a01
a11
a21
b20 b21 b22
a02
a12
a22
b20 b21 b22

This single row times a single column is equivalent to the dot product.


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).

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.

Matlab.

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.