Aller au contenu

Mathc complexes/c072b

Un livre de Wikilivres.


Application


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


c02b.c
/* ------------------------------------ */
/*  Save as :  c02b.c                   */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A  = r_mZ(i_mZ(r,r),9.);
double **B  = r_mZ(i_mZ(r,r),9.);
double **AB =      i_mZ(r,r);

  clrscrn();

  printf(" A \n");
  p_mZ(A, S3,P0, S3,P0, C6);

  printf(" B \n");
  p_mZ(B, S3,P0, S3,P0, C6);
  

  printf("\n det(A) * det(B) = ");
  p_Z( mul_Z(det_Z(A),det_Z(B)), S1,P0, S1,P0);
  
  printf("\n det(AB)         = ");
  p_Z(det_Z(mul_mZ(A,B,AB)), S1,P0, S1,P0);

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

  srand(time(&t));
  
do
{
  fun(rp_I(RC3)+RC1);
  
} while(stop_w());

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




Exemple de sortie écran :
 A 

 -7 +2i  +6 -7i  -5 -7i  -3 -5i 
 +6 +8i  +8 +6i  +8 +4i  -3 -1i 
 +2 +4i  -1 +8i  -7 +6i  +6 +2i 
 -1 -5i  +8 -9i  +4 -1i  +2 +8i 

 B 

 -3 +8i  -3 -7i  -3 -5i  -1 +8i 
 -1 +8i  +4 -9i  -9 +4i  -9 -1i 
 -5 -7i  +6 -9i  -3 +2i  +2 -1i 
 -7 -7i  -1 +8i  +8 +2i  +4 +8i 


 det(A) * det(B) = -190653948+856068064i 
 det(AB)         = -190653948+856068064i 
 Press return to continue
 Press X      to stop