Matrix Multiplication Tool
A simple tool for linear algebra students. Calculate the product of two 2x2 matrices instantly using this script.
×
=
Copy the Script
<script>
function multiply() {
// Get values (simplification)
var a00 = Number(document.getElementById("a00").value);
var a01 = Number(document.getElementById("a01").value);
// ... get rest of inputs ...
// Formula
// C00 = (A00 * B00) + (A01 * B10)
var c00 = (a00 * b00) + (a01 * b10);
// ... calculate rest ...
document.getElementById("r00").value = c00;
}
</script>
Frequently Asked Questions
This example is hardcoded for 2x2 for simplicity. However, the loop logic can be expanded to handle NxN matrices dynamically.
For result cell [0,0], you multiply Row 1 of Matrix A by Col 1 of Matrix B: `(A00 * B00) + (A01 * B10)`.
JavaScript uses floating-point math, so extremely precise scientific calculations might have tiny rounding errors (e.g., 0.000000004), but for standard algebra, it works perfectly.