# include "fits.h"

/******************* fits multiply matrix ***********************************/
int fits_multiply_matrix (M1, M2, M3) 
Matrix *M1, *M2, *M3;
{

  int i,j;
  double value;

  if ((M1[0].Naxis[0] != M2[0].Naxis[0]) ||
      (M1[0].Naxis[1] != M2[0].Naxis[1])) 
    return (FALSE);

  for (i = 0; i < M1[0].Naxis[0]; i++) {
    for (j = 0; j < M1[0].Naxis[1]; j++) {
      value = fits_get_matrix_value (M1, i, j);
      value *= fits_get_matrix_value (M2, i, j);
      fits_set_matrix_value (M3, i, j, value);
    }
  }
  
  return (TRUE);

}


