Skip to content
Snippets Groups Projects
Commit dd581a70 authored by slevy's avatar slevy
Browse files

Add some debugging code in mconjugate().

parent 3c024ba7
No related branches found
No related tags found
No related merge requests found
......@@ -279,6 +279,8 @@ void mconjugate( Matrix *To2wout, CONST Matrix *To2win, CONST Matrix *Tincrf,
mmmul( &t1, Tw2f, Tincrf );
mmmul( &t2, &t1, Tf2w );
mmmul( To2wout, To2win, &t2 );
//fprintf(stderr,"mconj dets: Tw2f %g Tincrf %g Tf2w %g To2win %g To2wout %g\n",
// mdet3(Tw2f),mdet3(Tincrf),mdet3(Tf2w),mdet3(To2win),mdet3(Tf2w),mdet3(To2wout));
} else {
mmmul( To2wout, To2win, Tincrf );
}
......@@ -372,6 +374,15 @@ float tfm2iquat( Point *iquat, CONST Matrix *T )
return (float)sqrtf(1 + trace) * .5f;
}
/* quickie determinant of 3x3 submatrix */
float mdet3( CONST Matrix *T )
{
return vlength((CONST Point *)&T->m[0]);
Point v01;
vcross( &v01, (CONST Point *)&T->m[0], (CONST Point *)&T->m[4] );
return vdot( &v01, (CONST Point *)&T->m[8] );
}
void tfm2quat( Quat *quat, CONST Matrix *T )
{
float ww, xx, yy, zz; /* i.e. w^2, x^2, etc. */
......
......@@ -128,6 +128,9 @@ void mmmul( Matrix *dst, CONST Matrix *a, CONST Matrix *b );
*/
void eucinv( Matrix *dst, CONST Matrix *src );
/* quickie determinant of 3x3 submatrix */
float mdet3( CONST Matrix *T );
/* matrix conjugation: see its use in Gview.C */
void mconjugate( Matrix *To2wout, CONST Matrix *To2win, CONST Matrix *Tincrf,
CONST Matrix *Tf2w, CONST Matrix *Tw2f,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment