Aller au contenu

Mathc complexes/a267

Un livre de Wikilivres.


Application


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

c00h.c
/* ------------------------------------ */
/*  Save as :   c00h.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 **umnsv  =  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(sub_mZ(u,v,umnsv),S3,P0,S3,P0,C6);
  
  printf("      <u-v,w> = <u,w>-<v,w>  \n\n");

  printf("     <u-v,w> =");
  p_Z(dot_Z(umnsv,w), S5,P0, S4,P0);printf("\n\n");

  printf(" <u,w>-<v,w> =");
  p_Z(sub_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(umnsv);
}
/* ------------------------------------ */
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 -2i 
 -1 +6i 
 +8 +8i 

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

 u-v :
 +0 -1i 
 +5 +0i 
 +7 +3i 

      <u-v,w> = <u,w>-<v,w>  

     <u-v,w> =   -6 -14i 

 <u,w>-<v,w> =   -6 -14i 

 Press   return to continue
 Press X return to stop