Aller au contenu

Mathc complexes/a265

Un livre de Wikilivres.


Application


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

c00f.c
/* ------------------------------------ */
/*  Save as :   c00f.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 **w  = r_mZ(i_mZ(r,C1),9.);

double **vplsw  =  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);
  printf(" v+w :");
  p_mZ(add_mZ(v,w,vplsw),S3,P0,S3,P0,C6);
 
  printf("      <u,v+w> = <u,v>+<u+w> \n\n");
  
  printf("      <u,v+w> =");
  p_Z(dot_Z(u,vplsw), S5,P0, S4,P0);printf("\n\n");

  printf("  <u,v>+<u,w> =");
  p_Z(add_Z(dot_Z(u,v),dot_Z(u,w)), S5,P0, S4,P0);printf("\n");
    
  f_mZ(u);
  f_mZ(v);
  f_mZ(w);
  f_mZ(vplsw);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));

do
{
  fun(rp_I(R2)+R1);


} while(stop_w());

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


Exemple de sortie écran :
 u :
 +8 +7i 
 +1 -3i 
 -6 -6i 

 v :
 +7 -1i 
 -4 +1i 
 +4 +3i 

 v+w :
 +3 -6i 
 -5 +8i 
 +7 +1i 

      <u,v+w> = <u,v>+<u+w> 

      <u,v+w> =  -95 +40i 

  <u,v>+<u,w> =  -95 +40i 

 Press   return to continue
 Press X return to stop