next up previous contents
Next: Distance between centers Up: Matrix algebra Previous: Copy matrix   Contents

Multiply matrices

 
/* sphmm - matrix = matrix * matrix */

void sphmm(z,x,y) double z[3][3], x[3][3], y[3][3]; {
int    i, j, k;
double u[3][3], v[3][3];
sphcm(u,x); sphcm(v,y);
for (i=0; i<3; i++) for (j=0; j<3; j++) {
  z[i][j]=0.0; for (k=0; k<3; k++) z[i][j]+=u[i][k]*v[k][j];
  }
}



Pedro Hernandez 2004-05-13