Matrix Calculator Perform addition, multiplication, determinant, inverse, and more — with step-by-step solutions and real...
Matrix Calculator
Perform addition, multiplication, determinant, inverse, and more — with step-by-step solutions and real-world applications.
Addition/Subtraction**:
$$ \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} + \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix} = \begin{bmatrix} 6 & 8 \\ 10 & 12 \end{bmatrix} $$
Multiplication**:
$$ \begin{bmatrix} a & b \\ c & d \end{bmatrix} \times \begin{bmatrix} e & f \\ g & h \end{bmatrix} = \begin{bmatrix} ae+bg & af+bh \\ ce+dg & cf+dh \end{bmatrix} $$
Determinant (2×2)**:
$$ \det \begin{bmatrix} a & b \\ c & d \end{bmatrix} = ad - bc $$
Inverse (2×2)**:
$$ A^{-1} = \frac{1}{\det(A)} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix} $$
✅ Pro Tip**: Always check **det(A) ≠ 0** before attempting inversion — if det = 0, matrix is singular (no inverse).
⚠️ Avoid these errors:
- AB ≠ BA** — Matrix multiplication is not commutative (e.g., rotation + scale ≠ scale + rotation)
- Dimension mismatch** — Can’t multiply 2×3 × 2×3 (inner dims 3 ≠ 2)
- Assuming inverse exists** — det = 0 → singular matrix (e.g., rows linearly dependent)
- Floating-point errors** — Inverses of near-singular matrices amplify rounding errors
✅ Real-World Uses**:
- CG**: 3D transformations (MVP matrix in WebGL)
- ML**: Linear regression coefficient calculation
- Circuits**: Solving Kirchhoff’s laws (Ax = b)
| Operation | Input | Result |
|---|---|---|
| Det(3×3) | [[2,-3,1],[2,0,3],[1,5,-2]] | −41 |
| Inv(2×2) | [[4,7],[2,6]] | [[0.6,−0.7],[−0.2,0.4]] |
| Mult(2×3 × 3×2) | A=[[1,2,3],[4,5,6]], B=[[7,8],[9,10],[11,12]] | [[58,64],[139,154]] |
📉 Key Properties**:
- det(AB) = det(A)·det(B)
- (AB)ᵀ = BᵀAᵀ
- Rank ≤ min(m,n)
➡️ Add/Subtract
“[[1,2],[3,4]] + [[5,6],[7,8]]” → [[6,8],[10,12]]
➡️ Multiply
2×3 × 3×2 → 2×2 result
➡️ Determinant
3×3 matrix → scalar (e.g., −41)
➡️ Inverse
2×2: [[4,7],[2,6]] → [[0.6,−0.7],[−0.2,0.4]]
Note: Supports 2×2 to 4×4. All operations use exact arithmetic (no approximation unless division required).