trick/trick_source/trick_utils/math/src/dmtxm.c
Michael Vetter 18f0d7e871 Remove trailing whitespaces
Makes it easier to edit the files. So if we press 'end of line' we are
really at the end of line.
2016-11-08 10:25:07 +01:00

31 lines
1.3 KiB
C

/*
PURPOSE: (Matrix transpose times matrix)
ASSUMPTIONS AND LIMITATIONS: ((3x3 Matrix implementation))
PROGRAMMERS: (((Les Quiocho) (NASA/JSC) (Jan 1990) (v1.0) (Init Release))) */
#include "trick/trick_math.h"
void dmtxm(double prod[3][3], /* Out: product of the two matrices */
double mat1[3][3], /* In: matrix 1 */
double mat2[3][3])
{ /* In: matrix 2 */
double trans[3][3];
dm_trans(trans, mat1);
prod[0][0] = trans[0][0] * mat2[0][0] + trans[0][1] * mat2[1][0] + trans[0][2] * mat2[2][0];
prod[0][1] = trans[0][0] * mat2[0][1] + trans[0][1] * mat2[1][1] + trans[0][2] * mat2[2][1];
prod[0][2] = trans[0][0] * mat2[0][2] + trans[0][1] * mat2[1][2] + trans[0][2] * mat2[2][2];
prod[1][0] = trans[1][0] * mat2[0][0] + trans[1][1] * mat2[1][0] + trans[1][2] * mat2[2][0];
prod[1][1] = trans[1][0] * mat2[0][1] + trans[1][1] * mat2[1][1] + trans[1][2] * mat2[2][1];
prod[1][2] = trans[1][0] * mat2[0][2] + trans[1][1] * mat2[1][2] + trans[1][2] * mat2[2][2];
prod[2][0] = trans[2][0] * mat2[0][0] + trans[2][1] * mat2[1][0] + trans[2][2] * mat2[2][0];
prod[2][1] = trans[2][0] * mat2[0][1] + trans[2][1] * mat2[1][1] + trans[2][2] * mat2[2][1];
prod[2][2] = trans[2][0] * mat2[0][2] + trans[2][1] * mat2[1][2] + trans[2][2] * mat2[2][2];
return;
}