Mathc matrices/c23f
Installer et compiler ces fichiers dans votre répertoire de travail.
c00f.c |
---|
/* ------------------------------------ */
/* Save as : c00f.c */
/* ------------------------------------ */
#include "v_a.h"
#include "dot_trac.h"
/* ------------------------------------ */
void fun(int r)
{
double **A = r_mR(i_mR(r,r),99.);
double **B = r_mR(i_mR(r,r),99.);
double **projAB = i_mR(r,r);
clrscrn();
printf(" A :");
p_mR(A,S3,P0,C6);
printf(" B :");
p_mR(B,S3,P0,C6);
stop();
clrscrn();
proj_TR_mR(A,B,projAB);
printf(" vector component of A along B \n\n");
printf(" projAB :");
p_mR(projAB,S10,P4,C6);
f_mR(A);
f_mR(B);
f_mR(projAB);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R3)+R2);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Nous calculons le projeté de la matrice A sur B.
Exemple de sortie écran :
------------------------------------
A :
+6 -39 +8 +52 +81
+74 -11 +78 +11 -26
+48 +44 +93 +81 +36
+22 -97 -76 -48 +77
+36 +94 -99 +56 -92
B :
-1 -88 +28 -35 +80
-8 +9 +59 -6 +9
-33 +31 -88 +97 -37
-22 +28 -77 +88 +60
-78 -69 -65 -70 +28
Press return to continue.
vector component of A along B
projAB :
-0.0468 -4.1207 +1.3111 -1.6389 +3.7461
-0.3746 +0.4214 +2.7627 -0.2810 +0.4214
-1.5452 +1.4516 -4.1207 +4.5421 -1.7325
-1.0302 +1.3111 -3.6056 +4.1207 +2.8095
-3.6524 -3.2310 -3.0437 -3.2778 +1.3111
Press return to continue
Press X to stop