O'Reilly logo

Beginning Math and Physics for Game Programmers by Wendy Stahler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Matrix Addition and Subtraction

Now that we've discussed checking for equal matrices, addition and subtraction will follow quite naturally. The preceding section said that corresponding entries are positioned in the same row and column location, and if two matrices are the same size with equal corresponding entries, they must be equal. For you to add matrices, they must also have the same dimensions. You just add corresponding entries.

Adding Matrices

For two matrices of the same size, add the corresponding entries.

NOTE

Always remember that two matrices must have the same dimensions for you to add them (just like equal matrices).

Also, some math texts refer to a matrix's dimensions as its order, so don't be thrown if you see that term used. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required