Aller au contenu

Mathc complexes/a261

Un livre de Wikilivres.


Application


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

c00b.c
/* ------------------------------------ */
/*  Save as :   c00b.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 **uplsv  =  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(" u+v :");
  p_mZ(add_mZ(u,v,uplsv),S3,P0,S3,P0,C6);
  
  printf("      <u+v,w> = <u,w>+<v,w>  [Additivity axiom] \n\n");
  
  printf("      <u+v,w> =");
  p_Z(dot_Z(uplsv,w), S5,P0, S4,P0);printf("\n");
  
  printf("  <u,w>+<v,w> =");
  p_Z(add_Z(dot_Z(u,w),dot_Z(v,w)), S5,P0, S4,P0);printf("\n");
    
  f_mZ(u);
  f_mZ(v);
  f_mZ(w);
  f_mZ(uplsv);
}
/* ------------------------------------ */
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 :
 +3 -3i 
 +9 -9i 
 +9 -1i 

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

 u+v :
 -1 +3i 
+12 -8i 
+13 +0i 

      <u+v,w> = <u,w>+<v,w>  [Additivity axiom] 

      <u+v,w> =  -55-112i 
  <u,w>+<v,w> =  -55-112i 

 Press   return to continue
 Press X return to stop