Mathc complexes/c05j
Installer et compiler ces fichiers dans votre répertoire de travail.
c01j.c |
---|
/* ------------------------------------ */
/* Save as : c01j.c */
/* ------------------------------------ */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **u = r_mZ(i_mZ(r,C1),9.);
double **v = r_mZ(i_mZ(r,C1),9.);
double **projuv = i_mZ(r,C1);
clrscrn();
printf(" u :");
p_mZ(u, S3,P0, S3,P0, C6);
printf(" v :");
p_mZ(v, S3,P0, S3,P0, C6);
proj_mZ(u,v,projuv);
printf(" vector component of u along v \n\n");
printf(" projuv :");
p_mZ(projuv, S3,P4, S3,P4, C6);
f_mZ(u);
f_mZ(v);
f_mZ(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é de u sur v : projuv_mZ(u,v,projuv); Exemple de sortie écran :
u :
+2 -1i
-5 -1i
+4 +6i
-1 -1i
+8 -9i
v :
-7 +8i
-5 +8i
-7 -9i
-1 -5i
-1 +2i
vector component of u along v
projuv :
+1.64-2.72i
+1.06-2.62i
+2.53+2.29i
+0.56+1.42i
+0.19-0.64i
Press return to continue
Press X to stop