Mathc complexes/c05h
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c01h.c |
---|
/* ------------------------------------ */
/* Save as : c01h.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **u = r_mZ(i_mZ(r,C1),9.);
double **n_u = i_mZ(r,C1);
clrscrn();
printf(" u :");
p_mZ(u, S8,P2, S6,P2, C6);
smul_mZ(1./norm_Z(u),u,n_u);
printf(" n_u = (1/||u||) u :");
p_mZ(n_u, S8,P4, S6,P4, C6);
printf(" ||n_u|| = %.6f \n\n", norm_Z(n_u));
f_mZ(u);
f_mZ(n_u);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R3)+R2);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Nous normalisons un vecteur colonne : smul_mZ(1./normuv_Z(u),u,n_u); Exemple de sortie écran :
u :
+2.00 -5.00i
-9.00 -5.00i
+8.00 +4.00i
+2.00 +2.00i
n_u = (1/||u||) u :
+0.13 -0.33i
-0.60 -0.33i
+0.54 +0.27i
+0.13 +0.13i
||n_u|| = 1.000000
Press return to continue
Press X to stop