MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / Solve33

Method Solve33

engine/source/Box2D/Common/b2Math.cpp:25–37  ·  view source on GitHub ↗

Solve A * x = b, where b is a column vector. This is more efficient than computing the inverse in one-shot cases.

Source from the content-addressed store, hash-verified

23/// Solve A * x = b, where b is a column vector. This is more efficient
24/// than computing the inverse in one-shot cases.
25b2Vec3 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.

Callers 4

Calls 2

b2DotFunction · 0.85
b2CrossFunction · 0.85

Tested by

no test coverage detected