Return the inverse matrix
| 30 | |
| 31 | // Return the inverse matrix |
| 32 | Matrix2x2 Matrix2x2::getInverse(decimal determinant) const { |
| 33 | |
| 34 | // Check if the determinant is equal to zero |
| 35 | assert(std::abs(determinant) > MACHINE_EPSILON); |
| 36 | |
| 37 | decimal invDeterminant = decimal(1.0) / determinant; |
| 38 | |
| 39 | Matrix2x2 tempMatrix(mRows[1][1], -mRows[0][1], -mRows[1][0], mRows[0][0]); |
| 40 | |
| 41 | // Return the inverse matrix |
| 42 | return (invDeterminant * tempMatrix); |
| 43 | } |
nothing calls this directly
no outgoing calls
no test coverage detected