Mathc matrices/c22f
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00c.c |
---|
/* ------------------------------------ */
/* Save as : c00c.c */
/* ------------------------------------ */
#include "v_a.h"
#include "dot_au.h"
/* ------------------------------------ */
void fun(int r)
{
double **A = r_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_Au_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_Au_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;
}
/* ------------------------------------ */
/* ------------------------------------ */
Nous normalisons U.
Exemple de sortie écran :
------------------------------------
A :
+8 -5 +6
-9 -5 -9
-5 -5 -3
u :
-7
+8
+4
n_u = (1/||u||) u :
-0.093193
+0.106506
+0.053253
||n_u|| = 1.000000
Press return to continue
Press X to stop