Mathc matrices/c22n
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00g.c |
---|
/* ------------------------------------ */
/* Save as : c00g.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,r),9.);
double **Orth = i_mR(r,r);
double **D = i_mR(r,r);
clrscrn();
printf(" A :");
p_mR(A,S3,P0,C6);
printf(" u :");
p_mR(U,S3,P0,C6);
stop();
clrscrn();
orth_Au_mR(A,U,Orth);
printf(" Orth :");
p_mR(Orth,S9,P4,C6);
mul_Au_mR(A,Orth,Orth,D);
printf(" D : <Orth,Orth> ");
p_mR(D,S12,P4,C6);
f_mR(A);
f_mR(U);
f_mR(Orth);
f_mR(D);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R3)+R2);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Nous orthogonalisons le vecteur u.
Exemple de sortie écran :
------------------------------------
A :
-7 +6 +2 +6
-3 -9 -1 +6
-5 -9 -7 -1
+6 +2 -9 +6
u :
-1 +4 +8 +4
-1 -3 +6 -3
+6 -7 +8 -9
-7 -9 +2 +4
Press return to continue.
Orth :
-1.000 +4.021 +10.231 +1.846
-1.000 -2.979 +5.078 -1.752
+6.000 -7.128 +2.270 +2.001
-7.000 -8.851 +0.952 +1.521
D : <Orth,Orth>
+13394.000 +0.000 +0.000 +0.000
+0.000 +18967.936 +0.000 -0.000
-0.000 -0.000 +22434.243 +0.000
+0.000 -0.000 +0.000 +489.962
Press return to continue
Press X to stop