Aller au contenu

Mathc complexes/a243

Un livre de Wikilivres.


Application


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


c06a.c
/* ------------------------------------ */
/*  Save as :   c06a.c                   */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
#define   RCA RC3
/* ------------------------------------ */
/* ------------------------------------ */
void fun()
{
double **Q      = r_Q_mZ(i_mZ(RCA,RCA), 9);
double **Qu     =        i_mZ(RCA,C1);
double **Qv     =        i_mZ(RCA,C1);
  
double **u      = r_mZ(i_mZ(RCA,C1),9.);
double **v      = r_mZ(i_mZ(RCA,C1),9.);


  clrscrn();   
  printf(" Q :                an orthogonal matrix ");
  p_mZ(Q,S3,P4,S3,P4,C6);
  
  printf(" u :");
  p_mZ(u,S3,P1,S3,P1,C6);

  printf(" v :");
  p_mZ(v,S3,P1,S3,P1,C6);
  
  printf("   Q u . Q v   \t=   u . v  \n\n ");
  printf("  ");
  p_Z(dot_Z(mul_mZ(Q,u,Qu), mul_mZ(Q,v,Qv)),S3,P0, S3,P0); 
  printf("   \t=   ");
  p_Z(dot_Z(u,v),S3,P0, S3,P0);
  printf("\n\n ");
 
   
  f_mZ(u);
  f_mZ(v); 
  f_mZ(Qu);
  f_mZ(Qv);
  f_mZ(Q);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

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

} while(stop_w());

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


Exemple de sortie écran :
 ------------------------------------ 

 Q :                an orthogonal matrix 
-0.4170-0.4170i +0.0588-0.6324i +0.1769+0.4663i 
+0.7298-0.1043i -0.5393-0.3971i -0.0016+0.0895i 
+0.3128+0.1043i +0.2696+0.2745i +0.7489+0.4271i 

 u :
-8.0-2.0i 
+9.0-8.0i 
-8.0-3.0i 

 v :
+5.0-8.0i 
-5.0+3.0i 
-4.0+4.0i 

   Q u . Q v   	=   u . v  

   -73-17i    	=   -73-17i 

 
 Press   return to continue
 Press X return to stop