Mathc matrices/c25m
Installer et compiler ces fichiers dans votre répertoire de travail.
c06b.c |
---|
/* ------------------------------------ */
/* Save as : c06b.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
#define RCA RC3
/* ------------------------------------ */
/* ------------------------------------ */
void fun()
{
double tu[RCA*C1]={
-7,
-6,
+8
};
double tv[RCA*C1]={
-5,
-4,
+7
};
double tQ[RCA*RCA]={
+0.301511344578, +0.275240941282, -0.912870929175,
+0.301511344578, -0.935819200357, -0.182574185835,
-0.904534033733, -0.220192753025, -0.365148371670,
};
double **u = ca_A_mR(tu,i_mR(RCA,C1));
double **v = ca_A_mR(tv,i_mR(RCA,C1));
double **Q = ca_A_mR(tQ,i_mR(RCA,RCA));
double **Qu = i_mR(RCA,C1);
double **Qv = i_mR(RCA,C1);
clrscrn();
printf(" Q : an orthogonal matrix ");
p_mR(Q,S3,P5,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\n",
dot_R(mul_mR(Q,u,Qu), mul_mR(Q,v,Qv)),
dot_R(u,v));
stop();
f_mR(u);
f_mR(v);
f_mR(Qu);
f_mR(Qv);
f_mR(Q);
}
/* ------------------------------------ */
int main(void)
{
fun();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Si Q est une matrice orthonormale alors : Qu.Qv = u.v :
Exemple de sortie écran :
--------------------------------
Q : an orthogonal matrix
+0.30151 +0.27524 -0.91287
+0.30151 -0.93582 -0.18257
-0.90453 -0.22019 -0.36515
u :
-7.0
-6.0
+8.0
v :
-5.0
-4.0
+7.0
Q u . Q v = u . v
115.0000 = 115.0000
Press return to continue.