Mathc matrices/c25h
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c04a.c */
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
double **u = r_mR(i_mR(RCQ,C1) ,9.);
double **Q = r_Q_mR(i_mR(RCQ,RCQ), 9);
double **Qu = i_mR(RCQ,C1);
 clrscrn();
 printf(" Q : an orthogonal matrix ");
 p_mR(Q,S3,P5,C6);
 printf(" u :");
 p_mR(u,S3,P5,C6);
 printf(" ||Q*u|| = ||u|| \n\n ");
 printf(" %.3f = %.3f \n\n ",
 norm_uv_R(mul_mR(Q,u,Qu)), norm_uv_R(u));
 f_mR(u); 
 f_mR(Qu);
 f_mR(Q);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun();
} while(stop_w());
 return 0;
/* ------------------------------------ */
 Vérifions que multiplier un vecteur par une matrice orthonormale ne change pas sa norme :
 Pour changer la taille des vecteurs il suffit de modifier la valeur de :

Exemple de sortie écran :
 Q : an orthogonal matrix 
+0.41036 +0.51736 +0.12756 +0.11981 -0.39152 -0.24662 
-0.36477 +0.39352 -0.11693 +0.04432 +0.24780 -0.30983 
+0.36477 +0.34609 -0.24873 -0.11938 +0.38439 +0.70654 
-0.41036 -0.23289 +0.29318 +0.39570 +0.18627 +0.31851 
+0.27358 -0.50849 -0.67285 +0.20042 -0.11563 -0.11490 
-0.31917 +0.16654 -0.45427 -0.35856 +0.31337 -0.25168 
+0.41036 -0.05157 +0.17607 +0.39655 +0.67762 -0.38740 
+0.22798 -0.33840 +0.36353 -0.69776 +0.17923 -0.12612 
+0.30133 -0.47792 
-0.64241 -0.35548 
-0.07555 -0.13558 
+0.29224 -0.55971 
-0.11771 -0.36507 
+0.60966 -0.04735 
+0.09666 +0.14868 
-0.10257 -0.39489 
 u :
+1.00000 
+7.00000 
+3.00000 
-8.00000 
+1.00000 
+3.00000 
-4.00000 
+5.00000 
 ||Q*u|| = ||u|| 
 13.191 = 13.191 
 Press return to continue
 Press X to stop

Mathc matrices/c25i
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c04b.c */
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)

double tu[RCQ*C1]={
 -7, 
 -6, 
 +8 
double tQ[RCQ*RCQ]={
+0.4819, +0.4615, +0.7448, 
+0.6196, -0.7806, +0.0828, 
+0.6196, +0.4216, -0.6621 
double **u = ca_A_mR(tu,i_mR(RCQ,C1));
double **Q = ca_A_mR(tQ,i_mR(RCQ,RCQ)); 
double **Qu = i_mR(RCQ,C1);
 clrscrn();
 printf(" Q : an orthogonal matrix ");
 p_mR(Q,S3,P5,C6);
 printf(" u :");
 p_mR(u,S3,P5,C6);
 printf(" ||Q*u|| = ||u|| \n\n ");
 printf(" %.3f = %.3f \n\n ",
 norm_uv_R(mul_mR(Q,u,Qu)), norm_uv_R(u));
 f_mR(u); 
 f_mR(Q);
 f_mR(Qu);
/* ------------------------------------ */
int main(void)
 fun();
 return 0;
/* ------------------------------------ */
 Vérifions que multiplier un vecteur par une matrice orthonormale ne change pas sa norme :
 Pour changer la taille des vecteurs il suffit de modifier la valeur de :
 et de rajouter éventuellement de nouvelles lignes et colonnes.

Exemple de sortie écran :
 Q : an orthogonal matrix 
+0.48190 +0.46150 +0.74480 
+0.61960 -0.78060 +0.08280 
+0.61960 +0.42160 -0.66210 
 u :
-7.00000 
-6.00000 
+8.00000 
 ||Q*u|| = ||u|| 
 12.207 = 12.207

Mathc matrices/c25j
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c05a.c */
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
double **u = r_mR(i_mR(RCQ,C1) ,9.);
double **v = r_mR(i_mR(RCQ,C1) ,9.);
double **Q = r_Q_mR(i_mR(RCQ,RCQ), 9); 
double **Qu = mul_mR(Q,u,i_mR(RCQ,C1));
double **Qv = mul_mR(Q,v,i_mR(RCQ,C1)); 
 clrscrn();
 printf(" Cosine of the Angle Between Vectors U and V :\n\n"); 
 printf(" u :");
 p_mR(u,S3,P0,C6);
 printf(" v :");
 p_mR(v,S3,P0,C6);
 printf(" <u,v> \n"
 " cos(alpha) = ----------- = %+.4f \n"
 " ||u|| ||v|| \n\n\n", 
 dot_uv_R(u,v)
 ( norm_uv_R(u) * norm_uv_R(v) )); 
 stop();
 clrscrn();
 printf(" Q :");
 p_mR(Q,S3,P4,C6); 
 stop();
 clrscrn();
 printf(" Cosine of the Angle Between Vectors U and V :\n\n"); 
 printf(" Qu :");
 p_mR(Qu,S3,P4,C6);
 printf(" Qv :");
 p_mR(Qv,S3,P4,C6);
 printf(" <Qu,Qv> \n"
 " cos(alpha) = ----------- = %+.4f \n"
 " ||u|| ||v|| \n", 
 dot_uv_R(Qu,Qv)
 ( norm_uv_R(u) * norm_uv_R(v) ));
 stop(); 
 clrscrn();
 printf(" Cosine of the Angle Between Vectors U and V :\n\n"); 
 printf(" <u,v> \n"
 " cos(alpha) = ----------- = %+.4f \n"
 " ||u|| ||v|| \n\n\n", 
 dot_uv_R(u,v)
 ( norm_uv_R(u) * norm_uv_R(v) ));
 printf(" <Qu,Qv> \n"
 " cos(alpha) = ----------- = %+.4f \n"
 " ||u|| ||v|| \n", 
 dot_uv_R(Qu,Qv)
 ( norm_uv_R(u) * norm_uv_R(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;
/* ------------------------------------ */
 Vérifions que multiplier deux vecteurs par une matrice orthonormale ne change pas leurs angles :
 Pour changer la taille des vecteurs il suffit de modifier la valeur de :
 Exemple de sortie écran :
 Cosine of the Angle Between Vectors U and V :
 u :
 -9 
 -5 
 -2 
 -6 
 +3 
 +2 
 v :
 -4 
 +4 
 +4 
 +3 
 -6 
 -8 
 <u,v> 
 cos(alpha) = ----------- = -0.2785 
 ||u|| ||v|| 
 Press return to continue. 
 --------------------------------
 Q :
+0.7526 -0.1921 +0.5607 -0.2189 -0.0255 +0.1837 
-0.3763 +0.0961 +0.3184 -0.3585 +0.7090 +0.3415 
-0.2822 +0.0338 +0.4022 +0.5563 -0.3333 +0.5805 
+0.1881 +0.7165 +0.2848 +0.3980 +0.2593 -0.3802 
-0.3763 +0.1725 +0.4706 -0.4767 -0.5056 -0.3525 
-0.1881 -0.6400 +0.3464 +0.3584 +0.2504 -0.4938 
 Press return to continue. 
 --------------------------------
 Cosine of the Angle Between Vectors U and V :
 Qu :
-5.3294 
+7.2304 
-1.6101 
-8.2160 
+2.2212 
+1.8138 
 Qv :
-3.5096 
-4.8984 
+1.8978 
+5.9324 
+8.5014 
+3.1015 
 <Qu,Qv> 
 cos(alpha) = ----------- = -0.2785 
 ||u|| ||v|| 
 Press return to continue. 
 --------------------------------
 Cosine of the Angle Between Vectors U and V :
 <u,v> 
 cos(alpha) = ----------- = -0.2785 
 ||u|| ||v|| 
 <Qu,Qv> 
 cos(alpha) = ----------- = -0.2785 
 ||u|| ||v|| 
 Press return to continue
 Press X to stop

Mathc matrices/c25k
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c05b.c */
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)

double tu[RCQ*C1]={
 -7, 
 -6, 
 +8 
double tv[RCQ*C1]={
 -5, 
 -4, 
 +7 
double tQ[RCQ*RCQ]={
+0.4819, +0.4615, +0.7448, 
+0.6196, -0.7806, +0.0828, 
+0.6196, +0.4216, -0.6621 
double **u = ca_A_mR(tu,i_mR(RCQ,C1));
double **v = ca_A_mR(tv,i_mR(RCQ,C1));
double **Q = ca_A_mR(tQ,i_mR(RCQ,RCQ)); 
double **Qu = mul_mR(Q,u,i_mR(RCQ,C1));
double **Qv = mul_mR(Q,v,i_mR(RCQ,C1)); 
 clrscrn();
 printf(" Cosine of the Angle Between Vectors U and V :\n\n"); 
 printf(" u :");
 p_mR(u,S3,P0,C6);
 printf(" v :");
 p_mR(v,S3,P0,C6);
 printf(" <u,v> \n"
 " cos(alpha) = ----------- = %+.4f \n"
 " ||u|| ||v|| \n\n\n", 
 dot_uv_R(u,v)
 ( norm_uv_R(u) * norm_uv_R(v) )); 
 stop();
 clrscrn();
 printf(" Q :");
 p_mR(Q,S3,P4,C6); 
 stop();
 clrscrn();
 printf(" Cosine of the Angle Between Vectors U and V :\n\n"); 
 printf(" Qu :");
 p_mR(Qu,S3,P4,C6);
 printf(" Qv :");
 p_mR(Qv,S3,P4,C6);
 printf(" <Qu,Qv> \n"
 " cos(alpha) = ----------- = %+.4f \n"
 " ||u|| ||v|| \n", 
 dot_uv_R(Qu,Qv)
 ( norm_uv_R(u) * norm_uv_R(v) ));
 stop(); 
 clrscrn();
 printf(" Cosine of the Angle Between Vectors U and V :\n\n"); 
 printf(" <u,v> \n"
 " cos(alpha) = ----------- = %+.4f \n"
 " ||u|| ||v|| \n\n\n", 
 dot_uv_R(u,v)
 ( norm_uv_R(u) * norm_uv_R(v) ));
 printf(" <Qu,Qv> \n"
 " cos(alpha) = ----------- = %+.4f \n"
 " ||u|| ||v|| \n", 
 dot_uv_R(Qu,Qv)
 ( norm_uv_R(u) * norm_uv_R(v) )); 
 f_mR(u);
 f_mR(v);
 f_mR(Qu);
 f_mR(Qv); 
 f_mR(Q);
/* ------------------------------------ */
int main(void)
 fun();
 return 0;
/* ------------------------------------ */
 Vérifions que multiplier deux vecteurs par une matrice orthonormale ne change pas leurs angles :
 Pour changer la taille des vecteurs il suffit de modifier la valeur de :
 et de rajouter éventuellement de nouvelles lignes et colonnes.