Solve A * x = b, where b is a column vector. This is more efficient than computing the inverse in one-shot cases.
| 23 | /// Solve A * x = b, where b is a column vector. This is more efficient |
| 24 | /// than computing the inverse in one-shot cases. |
| 25 | b2Vec3 b2Mat33::Solve33(const b2Vec3& b) const |
| 26 | { |
| 27 | float32 det = b2Dot(ex, b2Cross(ey, ez)); |
| 28 | if (det != 0.0f) |
| 29 | { |
| 30 | det = 1.0f / det; |
| 31 | } |
| 32 | b2Vec3 x; |
| 33 | x.x = det * b2Dot(b, b2Cross(ey, ez)); |
| 34 | x.y = det * b2Dot(ex, b2Cross(b, ez)); |
| 35 | x.z = det * b2Dot(ex, b2Cross(ey, b)); |
| 36 | return x; |
| 37 | } |
| 38 | |
| 39 | /// Solve A * x = b, where b is a column vector. This is more efficient |
| 40 | /// than computing the inverse in one-shot cases. |
no test coverage detected