Mathc matrices/c22j
Installer et compiler ces fichiers dans votre répertoire de travail.
c00e.c |
---|
/* ------------------------------------ */
/* Save as : c00e.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 **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_Au_mR(A,u,v,projuv);
printf(" vector component of u along v \n\n");
printf(" projuv :");
p_mR(projuv,S8,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;
}
/* ------------------------------------ */
/* ------------------------------------ */
Nous calculons le projeté orthogonal de u sur v.
Exemple de sortie écran :
------------------------------------
A :
+8 +4 -1 -7 -5
+8 +4 +6 -5 -9
-7 -9 -1 +6 +4
-3 +2 -7 -1 +2
-9 -7 -3 +2 -7
u :
-7
-3
-3
-1
+4
v :
+6
-9
-5
+4
+6
Press return to continue.
vector component of u along v
projuv :
+7
-10
-6
+5
+7
Press return to continue
Press X to stop