M3 m3diff(M3 m1, M3 m2) { m3DecXX(m1, m3GetXX(m2)); m3DecXY(m1, m3GetXY(m2)); m3DecXZ(m1, m3GetXZ(m2)); m3DecYX(m1, m3GetYX(m2)); m3DecYY(m1, m3GetYY(m2)); m3DecYZ(m1, m3GetYZ(m2)); m3DecZX(m1, m3GetZX(m2)); m3DecZY(m1, m3GetZY(m2)); m3DecZZ(m1, m3GetZZ(m2)); return(m1); }
char * m3fmt(M3 m) { char *p; /* get a buffer */ p = m3buf[nxtm3buf++]; nxtm3buf %= NM3BUF; (void)sprintf(p, "%22.15e %22.15e %22.15e", m3GetXX(m), m3GetXY(m), m3GetXZ(m)); (void)sprintf(p, "%s\n%22.15e %22.15e %22.15e", p, m3GetYX(m), m3GetYY(m), m3GetYZ(m)); (void)sprintf(p, "%s\n%22.15e %22.15e %22.15e", p, m3GetZX(m), m3GetZY(m), m3GetZZ(m)); return(p); }
M3 m3inv(M3 m) { M3 mi; m3SetXX(mi, m3GetXX(m)); m3SetXY(mi, m3GetYX(m)); m3SetXZ(mi, m3GetZX(m)); m3SetYX(mi, m3GetXY(m)); m3SetYY(mi, m3GetYY(m)); m3SetYZ(mi, m3GetZY(m)); m3SetZX(mi, m3GetXZ(m)); m3SetZY(mi, m3GetYZ(m)); m3SetZZ(mi, m3GetZZ(m)); return(mi); }