Java Script Linear Algebra II
By Marcus Kazmierczak
|
|
Enter Matrix B : |
|
What do you wish to calculate :
|
Solution Matrix C : |
The Mathematics Behind It
Let A represent our 3x3 Matrix.
| A + B = C | The addition of two matrices is straight forward. You just add each matrix position-wise. So the upper-left element of matrix A plus the upper-left element of matrix B is the upper-left element in matrix C. Do the same for all postions. |
| A x B = C | The multiplication of two matrices is not quite as simple. First we need the matrices to be of proper size. This means matrix A sizen x m must be multiplied by a mx p matrix. The resultant matrix will then be n x p. For our case, we are using two 3x3 matrices, so this isn't a problem. The equation for multiplying two matrices is : (elementwise)
A example element from our 3x3 Case. To get the first element in our solution matrix c11 c11 = (a11 * b11) + (a12 * b21) + (a13 * b31) |
On To : Java Script Linear Algebra Page III
E-Mail : marcus@mkaz.com