mirror of
https://github.com/nasa/trick.git
synced 2025-01-01 10:56:43 +00:00
18f0d7e871
Makes it easier to edit the files. So if we press 'end of line' we are really at the end of line.
31 lines
1.3 KiB
C
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;
|
|
}
|