136 Row[0].Set(m[0][0],m[0][1],m[0][2]);
137 Row[1].Set(m[1][0],m[1][1],m[1][2]);
138 Row[2].Set(m[2][0],m[2][1],m[2][2]);
143 Row[0].Set(m[0][0],m[0][1],m[0][2]);
144 Row[1].Set(m[1][0],m[1][1],m[1][2]);
145 Row[2].Set(m[2][0],m[2][1],m[2][2]);
150 Row[0].Set(m[0][0],m[0][1],m[0][2]);
151 Row[1].Set(m[1][0],m[1][1],m[1][2]);
152 Row[2].Set(m[2][0],m[2][1],m[2][2]);
157 Row[0].Set(m[0][0],m[0][1],m[0][2]);
158 Row[1].Set(m[1][0],m[1][1],m[1][2]);
159 Row[2].Set(m[2][0],m[2][1],m[2][2]);
164 Row[0][0] = (float)(1.0 - 2.0 * (
q[1] *
q[1] +
q[2] *
q[2]));
165 Row[0][1] = (float)(2.0 * (
q[0] *
q[1] -
q[2] *
q[3]));
166 Row[0][2] = (float)(2.0 * (
q[2] *
q[0] +
q[1] *
q[3]));
168 Row[1][0] = (float)(2.0 * (
q[0] *
q[1] +
q[2] *
q[3]));
169 Row[1][1] = (float)(1.0 - 2.0f * (
q[2] *
q[2] +
q[0] *
q[0]));
170 Row[1][2] = (float)(2.0 * (
q[1] *
q[2] -
q[0] *
q[3]));
172 Row[2][0] = (float)(2.0 * (
q[2] *
q[0] -
q[1] *
q[3]));
173 Row[2][1] = (float)(2.0 * (
q[1] *
q[2] +
q[0] *
q[3]));
174 Row[2][2] =(float)(1.0 - 2.0 * (
q[1] *
q[1] +
q[0] *
q[0]));
180 Row[0].Set(m[0][0],m[0][1],m[0][2]);
181 Row[1].Set(m[1][0],m[1][1],m[1][2]);
182 Row[2].Set(m[2][0],m[2][1],m[2][2]);
188 Row[0].Set(m[0][0],m[0][1],m[0][2]);
189 Row[1].Set(m[1][0],m[1][1],m[1][2]);
190 Row[2].Set(m[2][0],m[2][1],m[2][2]);
196 #define ROWCOL(i,j) a[i][0]*b[0][j] + a[i][1]*b[1][j] + a[i][2]*b[2][j]
198 (*res)[0][0] =
ROWCOL(0,0);
199 (*res)[0][1] =
ROWCOL(0,1);
200 (*res)[0][2] =
ROWCOL(0,2);
202 (*res)[1][0] =
ROWCOL(1,0);
203 (*res)[1][1] =
ROWCOL(1,1);
204 (*res)[1][2] =
ROWCOL(1,2);
206 (*res)[2][0] =
ROWCOL(2,0);
207 (*res)[2][1] =
ROWCOL(2,1);
208 (*res)[2][2] =
ROWCOL(2,2);
215 #define ROWCOL(i,j) a[i][0]*b[0][j] + a[i][1]*b[1][j] + a[i][2]*b[2][j]
217 (*res)[0][0] =
ROWCOL(0,0);
218 (*res)[0][1] =
ROWCOL(0,1);
219 (*res)[0][2] =
ROWCOL(0,2);
221 (*res)[1][0] =
ROWCOL(1,0);
222 (*res)[1][1] =
ROWCOL(1,1);
223 (*res)[1][2] =
ROWCOL(1,2);
225 (*res)[2][0] =
ROWCOL(2,0);
226 (*res)[2][1] =
ROWCOL(2,1);
227 (*res)[2][2] =
ROWCOL(2,2);
234 #define ROWCOL(i,j) a[i][0]*b[0][j] + a[i][1]*b[1][j] + a[i][2]*b[2][j]
247 #define ROWCOL(i,j) a[i][0]*b[0][j] + a[i][1]*b[1][j] + a[i][2]*b[2][j]
266void Matrix3x3::Symmetric_Eigen_Solve(
void)
274 eigen_vals.Compute_Jacobi_Rotation(i,j,&jr,&jrinv);
275 eigen_vals = jr * (eigenvals) * jrinv;
276 eigen_vecs = eigen_vecs * jr;
294 float tmp1,tmp2,tmp3;
310 (*set_res)[0][0] = (float)((*Aptr)[0][0]*tmp1 + (*Aptr)[0][1]*tmp2 + (*Aptr)[0][2]*tmp3);
311 (*set_res)[1][0] = (float)((*Aptr)[1][0]*tmp1 + (*Aptr)[1][1]*tmp2 + (*Aptr)[1][2]*tmp3);
312 (*set_res)[2][0] = (float)((*Aptr)[2][0]*tmp1 + (*Aptr)[2][1]*tmp2 + (*Aptr)[2][2]*tmp3);
318 (*set_res)[0][1] = (float)((*Aptr)[0][0]*tmp1 + (*Aptr)[0][1]*tmp2 + (*Aptr)[0][2]*tmp3);
319 (*set_res)[1][1] = (float)((*Aptr)[1][0]*tmp1 + (*Aptr)[1][1]*tmp2 + (*Aptr)[1][2]*tmp3);
320 (*set_res)[2][1] = (float)((*Aptr)[2][0]*tmp1 + (*Aptr)[2][1]*tmp2 + (*Aptr)[2][2]*tmp3);
326 (*set_res)[0][2] = (float)((*Aptr)[0][0]*tmp1 + (*Aptr)[0][1]*tmp2 + (*Aptr)[0][2]*tmp3);
327 (*set_res)[1][2] = (float)((*Aptr)[1][0]*tmp1 + (*Aptr)[1][1]*tmp2 + (*Aptr)[1][2]*tmp3);
328 (*set_res)[2][2] = (float)((*Aptr)[2][0]*tmp1 + (*Aptr)[2][1]*tmp2 + (*Aptr)[2][2]*tmp3);
void Re_Orthogonalize(void)
static const Matrix3x3 RotateX270
static const Matrix3x3 RotateZ270
static const Matrix3x3 RotateY180
static const Matrix3x3 RotateZ180
static const Matrix3x3 RotateZ90
static const Matrix3x3 RotateY270
static const Matrix3x3 RotateX180
static const Matrix3x3 RotateY90
static void Multiply(const Matrix3x3 &a, const Matrix3x3 &b, Matrix3x3 *res)
static const Matrix3x3 Identity
WWINLINE void Make_Identity(void)
WWINLINE Matrix3x3 & operator=(const Matrix3x3 &m)
void Set(const Matrix3D &m)
int Is_Orthogonal(void) const
static const Matrix3x3 RotateX90
static WWINLINE float Dot_Product(const Vector3 &a, const Vector3 &b)
WWINLINE float Length(void) const
static WWINLINE void Cross_Product(const Vector3 &a, const Vector3 &b, Vector3 *result)
static WWINLINE float Fabs(float val)
Matrix3x3 operator*(const Matrix3D &a, const Matrix3x3 &b)