|
From: <kin...@us...> - 2004-03-01 22:10:21
|
Update of /cvsroot/teem/teem/src/limn/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19188/limn/test Modified Files: soid.c Log Message: bug fixes relating to switch from column-major to row-major Index: soid.c =================================================================== RCS file: /cvsroot/teem/teem/src/limn/test/soid.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** soid.c 13 Feb 2004 22:57:30 -0000 1.10 --- soid.c 1 Mar 2004 21:59:03 -0000 1.11 *************** *** 23,53 **** char *info = ("Save a single ellipsoid or superquadric into an OFF file."); - void - washQtoM3(float m[9], float q[4]) { - float p[4], w, x, y, z, len; - - ELL_4V_COPY(p, q); - len = ELL_4V_LEN(p); - ELL_4V_SCALE(p, 1.0/len, p); - w = p[0]; - x = p[1]; - y = p[2]; - z = p[3]; - /* mathematica work implies that we should be - setting ROW vectors here */ - ELL_3V_SET(m+0, - 1 - 2*(y*y + z*z), - 2*(x*y - w*z), - 2*(x*z + w*y)); - ELL_3V_SET(m+3, - 2*(x*y + w*z), - 1 - 2*(x*x + z*z), - 2*(y*z - w*x)); - ELL_3V_SET(m+6, - 2*(x*z - w*y), - 2*(y*z + w*x), - 1 - 2*(x*x + y*y)); - } - int main(int argc, char *argv[]) { --- 23,26 ---- *************** *** 109,119 **** look->spow = 0; ! q[0] = 1.0; ! q[1] = p[0]; ! q[2] = p[1]; ! q[3] = p[2]; ! len = ELL_4V_LEN(q); ! ELL_4V_SCALE(q, 1.0/len, q); ! washQtoM3(mR, q); if (AIR_EXISTS(AB[0]) && AIR_EXISTS(AB[1])) { --- 82,88 ---- look->spow = 0; ! ELL_4V_SET(q, 1, p[0], p[1], p[2]); ! ELL_4V_NORM(q, q, len); ! ell_q_to_3m_f(mR, q); if (AIR_EXISTS(AB[0]) && AIR_EXISTS(AB[1])) { |