Mathc complexes/c05f

Un livre de Wikilivres.


Application


Installer et compiler ces fichiers dans votre répertoire de travail.

c01f.c
/* ------------------------------------ */
/*  Save as :   c01f.c                   */
/* ------------------------------------ */

/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **u  = r_mZ(i_mZ(r,C1),9.);

  clrscrn();
  printf(" u :");
  p_mZ(u, S3,P0, S3,P0, C6); 
  
  printf("          ||u|| = (<u,u>)^(1/2)\n\n");
    
  printf("  (<u,u>)^(1/2) = %.3f \n", 
          pow(Re_Z(dot_Z(u,u)) ,(1./2.)));
  
  printf("         ||u||  = %.3f \n\n",
            norm_Z(u));

  f_mZ(u);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));

do
{
  fun(rp_I(R3)+R2);
} while(stop_w());

  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Nous calculons la norme d'un vecteur : normuv_R(u);


Exemple de sortie écran :
 u :
 +6 -5i 
 -5 +6i 
 +2 -1i 

          ||u|| = (<u,u>)^(1/2)

  (<u,u>)^(1/2) = 11.269 
         ||u||  = 11.269 


 Press return to continue
 Press X      to stop