Mathc matrices/cq061
Installer et compiler ces fichiers dans votre répertoire de travail.
c00b.c |
---|
/* ------------------------------------ */
/* Save as : c00b.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **u = r_mR(i_mR(r,C1),9.);
double **v = r_mR(i_mR(r,C1),9.);
double **w = r_mR(i_mR(r,C1),9.);
double **uplsv = i_mR(r,C1);
clrscrn();
printf(" u :");
p_mR(u,S3,P0,C6);
printf(" v :");
p_mR(v,S3,P0,C6);
printf(" u+v :");
p_mR(add_mR(u,v,uplsv),S3,P0,C6);
stop();
clrscrn();
printf(" <u+v,w> = <u,w>+<v,w> [Additivity axiom] \n\n");
printf(" <u+v,w> = %.0f \n", dot_R(uplsv,w));
printf(" <u,w>+<v,w> = %.0f \n\n", dot_R(u,w)+dot_R(v,w));
f_mR(u);
f_mR(v);
f_mR(w);
f_mR(uplsv);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R3)+R2);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
u :
+2
+4
+3
-9
+3
v :
-1
+4
-6
+9
-2
u+v :
+1
+8
-3
+0
+1
Press return to continue.
<u+v,w> = <u,w>+<v,w> [Additivity axiom]
<u+v,w> = 10
<u,w>+<v,w> = 10
Press return to continue
Press X to stop