Mathc complexes/a209

Un livre de Wikilivres.

Application

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

c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(void)
{ 
double **U_T  = r_mZ(i_mZ(R1, C3), 9);  
double **V_T  = r_mZ(i_mZ(R1, C3), 9);   
 
double **UxV_T = i_mZ(R1, C3);
double **VxU_T = i_mZ(R1, C3);

double **A = m1_mZ(i_mZ(R3, C3));
double **B = m1_mZ(i_mZ(R3, C3));

  c_r_mZ(U_T, R1, A, R2);
  c_r_mZ(V_T, R1, A, R3);
  
  c_r_mZ(V_T, R1, B, R2);
  c_r_mZ(U_T, R1, B, R3);
  
// cofactor(A) -> (u x v)   
  c_z_mZ(cofactor_Z(A, R1, C1),       UxV_T, R1, C1);
  c_z_mZ(cofactor_Z(A, R1, C2*C2-C1), UxV_T, R1, C2);
  c_z_mZ(cofactor_Z(A, R1, C3*C2-C1), UxV_T, R1, C3);
//                          c*C2    : a number has two columns                              
//                              -C1 : The real part of the number

// cofactor(A) -> (v x u)   
  c_z_mZ(cofactor_Z(B, R1, C1),       VxU_T, R1, C1);
  c_z_mZ(cofactor_Z(B, R1, C2*C2-C1), VxU_T, R1, C2);
  c_z_mZ(cofactor_Z(B, R1, C3*C2-C1), VxU_T, R1, C3);
//                          c*C2    : a number has two columns                              
//                              -C1 : The real part of the number    
  clrscrn();       
  printf("  u_T  :");
  p_mZ(U_T, S3, P0, S2, P0, C6);
  printf("  v_T  :");
  p_mZ(V_T, S3, P0, S2, P0, C6);
                  

  printf("\n     u x v == -v x u     \n\n"
         "       u x v :");    
  p_mZ(UxV_T, S5, P0, S4, P0, C6);  
  printf("       v x u  :");
  p_mZ(VxU_T, S5, P0, S4, P0, C6);
  
  f_mZ(U_T); 
  f_mZ(V_T);
   
  f_mZ(A);
  f_mZ(B); 
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));
  
do
{  
  fun();

} while(stop_w());

  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  :
 -1-6i  -6+4i  -3-7i 

  v_T  :
 -8+3i  +6+5i  +2-3i 


     u x v == -v x u     

       u x v :
  -17 +83i   +65 +56i   -12  +9i 

       v x u  :
  +17 -83i   -65 -56i   +12  -9i 


 Press   return to continue
 Press X return to stop