Produit scalaire canonique dans Rn


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

c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **U             = r_mR(i_mR(r,r),9.);
double **Orth          =      i_mR(r,r);
double **Orth_Normal   =      i_mR(r,r);
double **Orth_Normal_T =      i_mR(r,r);

  clrscrn();
  printf(" U :");
  p_mR(U, S8,P4, C6); 

  orth_mR(U,Orth,YES);

  printf(" Orth_Normal :");
  p_mR(Orth, S8,P4, C6);  
  stop();

  clrscrn();
  printf(" Orth_Normal :");
  p_mR(Orth, S8,P4, C6); 
  
  printf(" Orth_Normal_T :");
  transpose_mR(Orth,Orth_Normal_T);
  p_mR(Orth_Normal_T, S8,P4, C6); 
    
  printf(" Orth_Normal_T * Orth_Normal  :");
  mul_mR(Orth_Normal_T,Orth, U);
  p_mR(U, S8,P4, C6);  
    
  f_mR(U);
  f_mR(Orth);
  f_mR(Orth_Normal);  
  f_mR(Orth_Normal_T);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));

do
{
  fun(rp_I(R2)+R2);
} while(stop_w());

  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Exemple de sortie écran :
 U :
 +9.0000  -6.0000  +6.0000 
 +1.0000  -9.0000  +7.0000 
 -3.0000  +8.0000  +2.0000 

 Orth_Normal :
 +0.9435  +0.2633  +0.2014 
 +0.1048  -0.8133  +0.5723 
 -0.3145  +0.5189  +0.7949 

 Press return to continue. 


 Orth_Normal :
 +0.9435  +0.2633  +0.2014 
 +0.1048  -0.8133  +0.5723 
 -0.3145  +0.5189  +0.7949 

 Orth_Normal_T :
 +0.9435  +0.1048  -0.3145 
 +0.2633  -0.8133  +0.5189 
 +0.2014  +0.5723  +0.7949 

 Orth_Normal_T * Orth_Normal  :
 +1.0000  -0.0000  +0.0000 
 -0.0000  +1.0000  +0.0000 
 +0.0000  +0.0000  +1.0000 


 Press   return to continue
 Press X return to stop