Application


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


c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(void)
{ 
double **U_T =    r_mR(i_mR(R1, C3), 9);  
double **V_T =    r_mR(i_mR(R1, C3), 9);  

double **UxV_T = i_mR(R1, C3);
double **UxV   = i_mR(R3, C1); 

double **A     = i_mR(R3, C3);

double **U = transpose_mR(U_T,  i_mR(R3 , C1));
double **V = transpose_mR(V_T,  i_mR(R3 , C1));

  c_r_mR(U_T, R1, A, R1);
  c_r_mR(U_T, R1, A, R2);
  c_r_mR(V_T, R1, A, R3);
  
  c_s_mR(cofactor_R(A, R1, C1), UxV_T, R1, C1);
  c_s_mR(cofactor_R(A, R1, C2), UxV_T, R1, C2);
  c_s_mR(cofactor_R(A, R1, C3), UxV_T, R1, C3);
  
  transpose_mR(UxV_T, UxV);
      
  clrscrn();       
  printf("  u_t  :");
  p_mR(U_T, S4, P0, C6);
  printf("  v_t  :");
  p_mR(V_T, S4, P0, C6);
  printf("  uxv_t :");
  p_mR(UxV_T, S4, P0, C6);

  printf("                  |  1  1  1 |    | u1 u2 u3 |            \n"  
         "  u.(u x v) == u. | u1 u2 u3 | == | u1 u2 u3 |  == det(A) \n"
         "                  | v1 v2 v3 |    | v1 v2 v3 |          \n\n"
         "  u.(u x v) == %+.4f                 det(A)     == %+.4f\n\n", 
  
                        dot_R(U, UxV),                    det_R(A) ); 
                                                  
  f_mR(U_T); 
  f_mR(V_T);
  f_mR(U); 
  f_mR(V);
  
  f_mR(UxV_T);
  f_mR(UxV);   

  f_mR(A);
}
/* ------------------------------------ */
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  :
  +7   -4   -8 

  v_t  :
  -2   +5   -5 

  uxv_t :
 +60  +51  +27 

                  |  1  1  1 |    | u1 u2 u3 |            
  u.(u x v) == u. | u1 u2 u3 | == | u1 u2 u3 |  == det(A) 
                  | v1 v2 v3 |    | v1 v2 v3 |          

  u.(u x v) == +0.0000                 det(A)     == -0.0000


 Press   return to continue
 Press X return to stop