Basically, we want to try to conver the matrix into
|1 0|
|0 1| (called I)
and record what we do on another I matrix. If an inverse exists we will be able to reduce our matrix to the I matrix. Thus we could begin:
|a, b|
|c, d|
and reduce it into row echelon form (hopefully ending in I), while keeping track of our steps with a copy of I.
Thankfully there are shortcuts that have been found, and for a 2D matrix it makes things pretty simple. Let us assume we have a matrix :
we first calculate the determinant =ad -bc
Then the inverse matrix (assuming the determinant (denoted |A| ) is
ie:
-
|d/(ad-bc), b/(bc-ad)|
-
|c/(bc-ad), a/(ad-bc)| //notice I have eliminted the signs by swapping the order of the eq'n in the denominator
-
Incidentally (and I'm sure you're not really interested, but this idea can be extended for larger matrices also).
THUS: All you need to do is write code to take 4 inputs (from text boxes arranged as a matrix) and to output four labels (again arranged as a matrix) solved using the equations above. Hope this helps!!! (If you are still having trouble, I may be able to help, but as I mentioned VB is not really my forte'....)