Mathc matrices/cq052
Installer et compiler ces fichiers dans votre répertoire de travail.
cq2.c |
---|
/* ------------------------------------ */
/* Save as : cq2.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **Q = r_Q_mR(i_mR(r,r), 9);
double **QT = i_mR(r,r);
double **T = i_mR(r,r);
clrscrn();
printf(" Q : an orthonormal matrix");
p_mR(Q,S3,P3,C6);
printf(" QT :");
transpose_mR(Q,QT);
p_mR(QT,S3,P3,C6);
stop();
clrscrn();
printf(" Q * QT : (QT = inv(Q)");
mul_mR(Q,QT,T);
p_mR(T,S3,P0,C6);
printf(" QT * Q : (Q = inv(QT)");
mul_mR(QT,Q,T);
p_mR(T,S3,P0,C6);
f_mR(Q);
f_mR(QT);
f_mR(T);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R3)+R2);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
La transposée d'une matrice orthogonale est son inverse :
Exemple de sortie écran :
Q : an orthogonal matrix (orthonormal !!)
+0.943 -0.329 +0.054
-0.236 -0.772 -0.591
-0.236 -0.544 +0.805
QT :
+0.943 -0.236 -0.236
-0.329 -0.772 -0.544
+0.054 -0.591 +0.805
Q * QT : (QT = inv(Q)
+1 -0 -0
-0 +1 +0
-0 +0 +1
QT * Q : (Q = inv(QT)
+1 -0 +0
-0 +1 +0
+0 +0 +1
Press return to continue
Press X to stop