Aller au contenu

Mathc complexes/a216

Un livre de Wikilivres.


Application

Installer et compiler ce fichier dans votre répertoire de travail.

c00b.c
/* ------------------------------------ */
/*  Save as :   c00b.c                  */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
int main(void)
{ 
double u_T[R1*(C3*C2)] ={ +6,-8, -7,+6, +2,+2};	
double v_T[R1*(C3*C2)] ={ -1,-2, +3,+9, +6,-1};
double w_T[R1*(C3*C2)] ={ -3,+7, +5,-2, +1,+9};
	
double **U_T = ca_A_mZ(u_T,i_mZ(R1,C3));  
double **V_T = ca_A_mZ(v_T,i_mZ(R1,C3));  
double **W_T = ca_A_mZ(w_T,i_mZ(R1,C3));
 
double **UxV_T           = i_mZ(R1, C3);
double **UxW_T           = i_mZ(R1, C3);
double **UxV_T_pls_UxW_T = i_mZ(R1, C3);

double **V_plus_W_T      = add_mZ(V_T,W_T,i_mZ(R1, C3));
double **Ux_VplusW_T     =                i_mZ(R1, C3);

  UxV_mZ(U_T,V_T,UxV_T);  
  UxV_mZ(U_T,W_T,UxW_T);

// (uxv) + (uxw)
  add_mZ(UxV_T,UxW_T,UxV_T_pls_UxW_T);

//  u x (v+w)    
  UxV_mZ(U_T,V_plus_W_T,Ux_VplusW_T);
    
  clrscrn();       
  printf("  u_T  :");
  p_mZ(U_T, S4, P0, S3, P0, C6);
  printf("  v_T  :");
  p_mZ(V_T, S4, P0, S3, P0, C6);
  printf("  w_T  :");
  p_mZ(W_T, S4, P0, S3, P0, C6);

  printf("\n\n"
         "    u  x (v+w) == (uxv) + (uxw) \n\n"  
         "    u  x (v+w) :");    
  p_mZ(Ux_VplusW_T,     S5, P0, S3, P0, C6);                       
  printf(" (uxv) + (uxw) :");
  p_mZ(UxV_T_pls_UxW_T, S5, P0, S3, P0, C6);
  
  f_mZ(U_T); 
  f_mZ(V_T);
  f_mZ(W_T);  

  f_mZ(UxV_T); 
  f_mZ(UxW_T);
  f_mZ(UxV_T_pls_UxW_T); 

  f_mZ(V_plus_W_T);
  f_mZ(Ux_VplusW_T);
  
  stop();
  
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */

Les vecteurs en mathématiques sont supposés être des vecteurs colonnes, c'est pour cela que j'utilise _T pour afficher des vecteurs lignes.

Exemple de sortie écran :

  u_T  :
  +6 -8i   -7 +6i   +2 +2i 

  v_T  :
  -1 -2i   +3 +9i   +6 -1i 

  w_T  :
  -3 +7i   +5 -2i   +1 +9i 



    u  x (v+w) == (uxv) + (uxw) 

    u  x (v+w) :
  -99-44i  -124+10i  +106+37i 

 (uxv) + (uxw) :
  -99-44i  -124+10i  +106+37i 

 Press return to continue.