2 x 2 matrix division

A 2 x 2 matrix A multiplied by a 2 x 2 matrix B is a 2 x 2 matrix AB. This tool helps to find the inverse of matrix B so that we can find out what matrix A is.

Multiplication of a matrix:

\begin{align} \left(\ \begin{matrix} a & b \\ c & d \end{matrix}\right) \left(\ \begin{matrix} e & f \\ g & h \end{matrix}\right) = \left(\ \begin{matrix} ae+bg & af+bh \\ ce+dg & cf+dh \end{matrix}\right) = \left(\ \begin{matrix} i & j \\ k & l \end{matrix}\right) \end{align}

So when you divide one matrix by another, you have to solve some equations.

// Warning! This code may be inaccurate in syntax or may not work properly.
// Please refrain from using it.
function divide2x2matrix(e,f,g,h,i,j,k,l)
 *We assume that the matrix is in the form [[i,j],[k,l]] and [[e,f],[g,h]].
 *The first bracket  is the upper row, second bracket lower row.
 *Matrix returned: [[a,b],[c,d]]
 *The first step is to solve the simultaneous equations.
 *The simultaneous equations are:
 *ae+bg=i }
 *af+bh=j }focus on these first
 *ce+dg=k }
 *cf+dh=l }then focus on these
 *Using the same method:
var discrim=(e*h-g*f)
if (discrim!=0) {
return a,b,c,d;
else {
alert("The answer is undefined");
return "undefined product";
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License