Mathc complexes/c05k
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c01k.c |
---|
/* ------------------------------------ */
/* Save as : c01k.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);
double **umnsprojuv = i_mZ(r,C1);
clrscrn();
printf(" u :");
p_mZ(u, S8,P0, S6,P0, C6);
printf(" v :");
p_mZ(v, S8,P0, S6,P0, C6);
stop();
clrscrn();
proj_mZ(u,v,projuv);
printf(" vector component of u along v \n\n");
printf(" projuv :");
p_mZ(projuv, S8,P4, S6,P4, C6);
stop();
clrscrn();
printf(" vector component of u orthogonal to v \n\n");
printf(" u - projuv :");
sub_mZ(u,projuv,umnsprojuv);
p_mZ(umnsprojuv, S8,P4, S6,P4, C6);
printf(" <v,u - projuv> =");
p_Z(dot_Z(v,umnsprojuv), S6,P4, S6,P4);
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 vérifions une des propriétés du projeté de u sur v : <v,u - projuv> = -0.000000 Exemple de sortie écran :
u :
+2.00 -3.00i
+8.00 +8.00i
-9.00 +6.00i
-5.00 -9.00i
-5.00 +6.00i
v :
-5.00 -5.00i
+4.00 +8.00i
+6.00 -3.00i
+4.00 -1.00i
+8.00 -3.00i
Press return to continue.
vector component of u along v
projuv :
+0.64 +0.87i
-0.42 -1.30i
-0.97 +0.32i
-0.63 +0.06i
-1.28 +0.27i
Press return to continue.
vector component of u orthogonal to v
u - projuv :
+1.36 -3.87i
+8.42 +9.30i
-8.03 +5.68i
-4.37 -9.06i
-3.72 +5.73i
<v,u - projuv> = +0.00 +0.00i
Press return to continue
Press X to stop