Mathc matrices/c20f
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00c.c */
void fun(int r)
double **A = rpdiag_mR( i_mR(r,r ), 9.);
double **u = r_mR( i_mR(r,C1), 9.);
double **n_u = i_mR(r,C1);
 clrscrn();
 printf(" A :");
 p_mR(A,S3,P0,C6);
 printf(" u :");
 p_mR(u,S3,P0,C6);
 smul_mR(1./norm_Diag_R(A,u),u,n_u); 
 printf(" n_u = (1/||u||) u :");
 p_mR(n_u,3,6,6); 
 printf(" ||n_u|| = %.6f \n\n",norm_Diag_R(A,n_u));
 f_mR(A);
 f_mR(u);
 f_mR(n_u);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun(rp_I(R2)+R1);
} while(stop_w());
 return 0;
/* ------------------------------------ */
On normalise un vecteur.

Exemple de sortie écran :
 A :
 +6 +0 +0 
 +0 +5 +0 
 +0 +0 +5 
 u :
 -4 
 -1 
 +7 
 n_u = (1/||u||) u :
-0.215041 
-0.053760 
+0.376322 
 ||n_u|| = 1.000000 
 Press return to continue
 Press X to stop

Mathc matrices/c20g
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00a.c */
void fun(void)
double a[R2*C2]={ 2,0,
 0,3};
double u[R2*C1]={ 1,
 1};
double v[R2*C1]={ 3,
 2}; 
double **A = ca_A_mR(a,i_mR(R2,C2));
double **U = ca_A_mR(u,i_mR(R2,C1));
double **V = ca_A_mR(v,i_mR(R2,C1));
 clrscrn();
 printf(" A :");
 p_mR(A,S3,P0,C6);
 printf(" U :");
 p_mR(U,S3,P0,C6);
 printf(" V :");
 p_mR(V,S3,P0,C6);
 printf(" <U,V> = V^t sqrt(A)^t sqrt(A) U \n");
 printf(" <U,V> = %.0f \n", dot_Diag_R(A,U,V));
 printf(" <V,U> = %.0f \n\n", dot_Diag_R(A,V,U));
 f_mR(A);
 f_mR(U);
 f_mR(V);
/* ------------------------------------ */
int main(void)
 fun();
 stop();
 return 0;
/* ------------------------------------ */

Exemple de sortie écran :
 A :
 +2 +0 
 +0 +3 
 U :
 +1 
 +1 
 V :
 +3 
 +2 
 <U,V> = V^t sqrt(A)^t sqrt(A) U 
 <U,V> = 12 
 <V,U> = 12 
 Press return to continue.

Mathc matrices/c20h
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00d.c */
void fun(int r)
double **A = rpdiag_mR(i_mR(r,r ),9.);
double **u = r_mR(i_mR(r,C1),9.);
double **v = r_mR(i_mR(r,C1),9.);
 clrscrn();
 printf(" A :");
 p_mR(A,S3,P0,C6);
 printf(" u :");
 p_mR(u,S3,P0,C6);
 printf(" v :");
 p_mR(v,S3,P0,C6);
 printf(" d(u,v) = ||u-v||^(1/2) \n\n");
 printf(" d(u,v) = %.3f \n", dist_Diag_R(A,u,v));
 printf(" d(v,u) = %.3f \n\n", dist_Diag_R(A,v,u));
 f_mR(A);
 f_mR(u);
 f_mR(v);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun(rp_I(R2)+R1);
} while(stop_w());
 return 0;
/* ------------------------------------ */
On calcul la distance entre deux vecteurs.

Exemple de sortie écran :
 A :
 +9 +0 
 +0 +1 
 u :
 -2 
 +6 
 v :
 +1 
 +2 
 d(u,v) = ||u-v||^(1/2) 
 d(u,v) = 9.849 
 d(v,u) = 9.849 
 Press return to continue
 Press X to stop

Mathc matrices/c20i
Application 
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00b.c */
void fun(void)
double a[R2*C2]={ 2,0,
 0,3};
double v[R2*C1]={ 3,
 2}; 
double w[R2*C1]={ 0,
 -1};
double k = 3; 
double **A = ca_A_mR(a, i_mR(R2,C2));
double **V = ca_A_mR(v, i_mR(R2,C1));
double **kV = smul_mR(k,V,i_mR(R2,C1));
double **W = ca_A_mR(w, i_mR(R2,C1));
 clrscrn();
 printf(" A :");
 p_mR(A,S3,P0,C6);
 printf(" V :");
 p_mR(V,S3,P0,C6); 
 printf(" W :");
 p_mR(W,S3,P0,C6);
 printf(" %.0f V :",k);
 p_mR(kV,S3,P0,C6); 
 printf(" <kV,W> = k<V,W> [Homogeneity axiom] \n\n");
 printf(" <kV,W> = %.0f \n", dot_Diag_R(A,kV,W));
 printf(" k<V,W> = %.0f \n\n", k*dot_Diag_R(A,V, W));

f_mR(A);
 f_mR(V);
 f_mR(kV);
 f_mR(W);
/* ------------------------------------ */
int main(void)
 fun();
 stop();
 return 0;
/* ------------------------------------ */

Exemple de sortie écran :
 A :
 +2 +0 
 +0 +3 
 V :
 +3 
 +2 
 W :
 +0 
 -1 
 3 V :
 +9 
 +6 
 <kV,W> = k<V,W> [Homogeneity axiom] 
 <kV,W> = -18 
 k<V,W> = -18 
 Press return to continue.

Mathc matrices/c20j
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00e.c */
void fun(int r)
double **A = rpdiag_mR(i_mR(r,r ),9.);
double **u = r_mR(i_mR(r,C1),9.);
double **v = r_mR(i_mR(r,C1),9.);
double **projuv = i_mR(r,C1);
 clrscrn();
 printf(" A :");
 p_mR(A,S3,P0,C6);
 printf(" u :");
 p_mR(u,S3,P0,C6);
 printf(" v :");
 p_mR(v,S3,P0,C6);
 stop();
 clrscrn(); 
 proj_Diag_mR(A,u,v,projuv);
 printf(" vector component of u along v \n\n"); 
 printf(" projuv :");
 p_mR(projuv,S3,P4,C6);
 f_mR(A);
 f_mR(u);
 f_mR(v);
 f_mR(projuv);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun(rp_I(R3)+R2);
} while(stop_w());
 return 0;
/* ------------------------------------ */
On calcule le projeté de u sur v.

Exemple de sortie écran :
 A :
 +1 +0 +0 +0 
 +0 +2 +0 +0 
 +0 +0 +5 +0 
 +0 +0 +0 +8 
 u :
 -8 
 -7 
 -5 
 -9 
 v :
 +9 
 -8 
 +8 
 +3 
 Press return to continue. 
 ------------------------------------ 
 vector component of u along v 
 projuv :
-5.6306 
+5.0050 
-5.0050 
-1.8769 
 Press return to continue
 Press X to stop

Mathc matrices/c20k
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00f.c */
void fun(int r)
double **A = rpdiag_mR(i_mR(r,r ),9.);
double **u = r_mR(i_mR(r,C1),9.);
double **v = r_mR(i_mR(r,C1),9.);
double **projuv = i_mR(r,C1);
double **umnsprojuv = i_mR(r,C1);
 clrscrn();
 printf(" A :");
 p_mR(A,S3,P0,C6);
 printf(" u :");
 p_mR(u,S3,P0,C6);
 printf(" v :");
 p_mR(v,S3,P0,C6);
 proj_Diag_mR(A,u,v,projuv);
 printf(" vector component of u along v \n\n"); 
 printf(" projuv :");
 p_mR(projuv,S3,P4,C6);
 stop();
 clrscrn();
 printf(" vector component of u orthogonal to v \n\n");
 printf(" u-projuv :");
 sub_mR(u,projuv,umnsprojuv);
 p_mR(umnsprojuv,S3,P4,C6);
 printf(" <v, u-projuv> = %.12f \n\n", dot_Diag_R(A,v,umnsprojuv));
 f_mR(A);
 f_mR(u);
 f_mR(v);
 f_mR(projuv);
 f_mR(umnsprojuv);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun(R3);
} while(stop_w());
 return 0;
/* ------------------------------------ */
On vérifie une propriétée.

Exemple de sortie écran :
 A :
 +1 +0 +0 
 +0 +1 +0 
 +0 +0 +4 
 u :
 +7 
 -9 
 +1 
 v :
 -5 
 -4 
 -9 
 vector component of u along v 
 projuv :
+0.4795 
+0.3836 
+0.8630 
 Press return to continue. 
 ------------------------------------ 
 vector component of u orthogonal to v 
 u-projuv :
+6.5205 
-9.3836 
+0.1370 
 <v, u-projuv> = -0.000000000000 
 Press return to continue
 Press X to stop

Mathc matrices/c20l
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00c.c */
void fun(void)
double a[R2*C2]={ 2,0,
 0,3};
double u[R2*C1]={ 1,
 1};
double v[R2*C1]={ 3,
 2}; 
double w[R2*C1]={ 0,
 -1};
double **A = ca_A_mR(a,i_mR(R2,C2));
double **U = ca_A_mR(u,i_mR(R2,C1));
double **V = ca_A_mR(v,i_mR(R2,C1));
double **W = ca_A_mR(w,i_mR(R2,C1));
double **UplsV = add_mR(U,V,i_mR(R2,C1));
 clrscrn();
 printf(" A :");
 p_mR(A,S3,P0,C6);
 printf(" U :");
 p_mR(U,S3,P0,C6); 
 printf(" V :");
 p_mR(V,S3,P0,C6); 
 printf(" W :");
 p_mR(W,S3,P0,C6); 
 printf(" UplsV :");
 p_mR(UplsV,S3,P0,C6); 
 stop();
 clrscrn(); 
 printf(" <U+V,W> = <U,W>+<V,W> [Additivity axiom] \n\n");
 printf(" <u+v,w> = %.0f \n", dot_Diag_R(A,UplsV,W));
 printf(" <u,w>+<v,w> = %.0f \n\n", dot_Diag_R(A,U, W)+
 dot_Diag_R(A,V, W));
 f_mR(A);
 f_mR(U);
 f_mR(V);
 f_mR(W);
 f_mR(UplsV); 
/* ------------------------------------ */
int main(void)
 fun();
 stop();
 return 0;
/* ------------------------------------ */