MCPcopy Create free account
hub / github.com/EricLengyel/Terathon-Math-Library / MakeRotation

Method MakeRotation

TSMatrix3D.cpp:172–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172Matrix3D Matrix3D::MakeRotation(float angle, const Bivector3D& axis)
173{
174 float c, s;
175
176 CosSin(angle, &c, &s);
177 float d = 1.0F - c;
178
179 float x = axis.x * d;
180 float y = axis.y * d;
181 float z = axis.z * d;
182 float axay = x * axis.y;
183 float axaz = x * axis.z;
184 float ayaz = y * axis.z;
185
186 return (Matrix3D(c + x * axis.x, axay - s * axis.z, axaz + s * axis.y,
187 axay + s * axis.z, c + y * axis.y, ayaz - s * axis.x,
188 axaz - s * axis.y, ayaz + s * axis.x, c + z * axis.z));
189}
190
191Matrix3D Matrix3D::MakeReflection(const Vector3D& a)
192{

Callers

nothing calls this directly

Calls 3

CosSinFunction · 0.85
Matrix3DClass · 0.85
Transform2DClass · 0.85

Tested by

no test coverage detected