Mathc matrices/c23e
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00d.c |
---|
/* ------------------------------------ */
/* Save as : c00d.c */
/* ------------------------------------ */
#include "v_a.h"
#include "dot_trac.h"
/* ------------------------------------ */
void fun(int r)
{
double **A = r_mR(i_mR(r,r ),9.);
double **n_A = i_mR(r,r);
clrscrn();
printf(" A :");
p_mR(A,S3,P0,C6);
smul_mR(1./norm_TR_R(A),A,n_A);
printf(" n_A = (1/||A||) A :");
p_mR(n_A,S3,P4,C6);
printf(" ||n_A|| = %.4f \n\n", norm_TR_R(n_A));
f_mR(A);
f_mR(n_A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R3)+R2);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Nous normalisons.
Exemple de sortie écran :
------------------------------------
A :
-5 -4 +6
-7 +8 -9
-6 -9 -6
n_A = (1/||A||) A :
-0.2428 -0.1943 +0.2914
-0.3400 +0.3885 -0.4371
-0.2914 -0.4371 -0.2914
||n_A|| = 1.0000
Press return to continue
Press X to stop