Solve A * x = b, where b is a column vector. This is more efficient than computing the inverse in one-shot cases.
| 39 | /// Solve A * x = b, where b is a column vector. This is more efficient |
| 40 | /// than computing the inverse in one-shot cases. |
| 41 | b2Vec2 b2Mat33::Solve22(const b2Vec2& b) const |
| 42 | { |
| 43 | float32 a11 = ex.x, a12 = ey.x, a21 = ex.y, a22 = ey.y; |
| 44 | float32 det = a11 * a22 - a12 * a21; |
| 45 | if (det != 0.0f) |
| 46 | { |
| 47 | det = 1.0f / det; |
| 48 | } |
| 49 | b2Vec2 x; |
| 50 | x.x = det * (a22 * b.x - a12 * b.y); |
| 51 | x.y = det * (a11 * b.y - a21 * b.x); |
| 52 | return x; |
| 53 | } |
| 54 | |
| 55 | /// |
| 56 | void b2Mat33::GetInverse22(b2Mat33* M) const |
no outgoing calls
no test coverage detected