Mathc matrices/c25l
Installer et compiler ces fichiers dans votre répertoire de travail.
c06a.c |
---|
/* ------------------------------------ */
/* Save as : c06a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
#define RCA RC3
/* ------------------------------------ */
/* ------------------------------------ */
void fun()
{
double **Q = r_Q_mR(i_mR(RCA,RCA), 9);
double **Qu = i_mR(RCA,C1);
double **Qv = i_mR(RCA,C1);
double **u = r_mR(i_mR(RCA,C1),9.);
double **v = r_mR(i_mR(RCA,C1),9.);
clrscrn();
printf(" Q : an orthogonal matrix ");
p_mR(Q,S3,P4,C6);
printf(" u :");
p_mR(u,S3,P1,C6);
printf(" v :");
p_mR(v,S3,P1,C6);
printf(" Q u . Q v\t = u . v \n\n ");
printf(" %.4f\t = %.4f \n",
dot_R(mul_mR(Q,u,Qu), mul_mR(Q,v,Qv)),
dot_R(u,v));
f_mR(u);
f_mR(v);
f_mR(Qu);
f_mR(Qv);
f_mR(Q);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun();
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Si Q est une matrice orthonormale alors : Qu.Qv = u.v :
Exemple de sortie écran :
--------------------------------
Q : an orthogonal matrix
-0.0937 +0.4562 +0.8849
-0.7493 +0.5530 -0.3644
+0.6556 +0.6972 -0.2900
u :
-7.0
-8.0
+6.0
v :
+6.0
-1.0
-1.0
Q u . Q v = u . v
-40.0000 = -40.0000
Press return to continue
Press X to stop