Aller au contenu

Mathc complexes/a350

Un livre de Wikilivres.


Les matrices orthonormales, orthogonales


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

c00c.c
/* ------------------------------------ */
/*  save as :   c00c.c                  */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define   RA R3
#define   CA C3
#define   CB C3
/* ------------------------------------ */
void fun(void)
{
double **A    =         r_Q_mZ(           i_mZ(RA,CA),99);
double **B    =           r_mZ(           i_mZ(RA,CB),99.);
double **Ab   = i_Abr_Ac_bc_mZ(RA,CA,CB);

double **A_T  =  ctranspose_mZ(A,         i_mZ(RA,CA));
double **A_TB =         mul_mZ(A_T,B,     i_mZ(RA,CB));

  clrscrn();
  printf(" A : Orthonormal");
  p_mZ(A, S9,P4, S8,P4, C3);

  printf("  b[*] :");
  p_mZ(B, S9,P4, S8,P4, C3);

  printf(" Ab :");
  c_A_b_Ab_mZ(A,B,Ab);
  p_mZ(Ab, S9,P4, S8,P4, C3);
  stop();
  
  clrscrn(); 
  printf("  gj_mZ(Ab) :");
  gj_mZ(Ab);
  p_mZ(Ab, S9,P4, S8,P4, C3);
  
  printf(" A_T * B ");
  p_mZ(A_TB, S9,P4, S8,P4, C3);

  f_mZ(A);
  f_mZ(B);
  f_mZ(Ab);  
  f_mZ(A_T);
  f_mZ(A_TB);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

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


} while(stop_w());

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


Exemple de sortie écran :
 A : Orthonormal
  +0.8232 -0.2703i   +0.1307 +0.1537i   +0.4135 -0.1938i 
  +0.1843 +0.2580i   -0.4698 -0.5789i   -0.1049 -0.5767i 
  +0.3317 -0.1966i   +0.1460 -0.6182i   -0.3332 +0.5803i 

  b[*] :
 -53.0000+15.0000i  +86.0000+67.0000i  -58.0000-21.0000i 
 +81.0000-88.0000i  +64.0000+56.0000i   +4.0000-59.0000i 
 -15.0000-44.0000i  -19.0000+80.0000i  -81.0000-88.0000i 

 Ab :
  +0.8232 -0.2703i   +0.1307 +0.1537i   +0.4135 -0.1938i 
  +0.1843 +0.2580i   -0.4698 -0.5789i   -0.1049 -0.5767i 
  +0.3317 -0.1966i   +0.1460 -0.6182i   -0.3332 +0.5803i 

 -53.0000+15.0000i  +86.0000+67.0000i  -58.0000-21.0000i 
 +81.0000-88.0000i  +64.0000+56.0000i   +4.0000-59.0000i 
 -15.0000-44.0000i  -19.0000+80.0000i  -81.0000-88.0000i 

 Press return to continue. 


  gj_mZ(Ab) :
  +1.0000 +0.0000i   +0.0000 +0.0000i   +0.0000 +0.0000i 
  +0.0000 +0.0000i   +1.0000 +0.0000i   -0.0000 +0.0000i 
  -0.0000 +0.0000i   +0.0000 +0.0000i   +1.0000 +0.0000i 

 -51.7890-56.6423i  +56.9003+95.0141i  -66.1277-89.9887i 
 +33.2873+82.6437i  -93.1772 +6.2106i  +64.0476-26.7150i 
  -3.1065+75.2454i  +36.3190+59.7750i  -10.3824+64.9043i 

 A_T * B 
 -51.7890-56.6423i  +56.9003+95.0141i  -66.1277-89.9887i 
 +33.2873+82.6437i  -93.1772 +6.2106i  +64.0476-26.7150i 
  -3.1065+75.2454i  +36.3190+59.7750i  -10.3824+64.9043i 


 Press   return to continue
 Press X return to stop