< Mathc complexes


Sommaire


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


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

int minor_r = rp_I(r);
int minor_c = rp_I(r);

  clrscrn();
  printf(" A :");
  p_mZ(A,5,0,5,0,6);

  printf(" cofactor(%d,%d) = ", minor_r, minor_c);

  minor_c = minor_c*C2-C1;
  /* col*C2 : a number has two columns    */                         
  /*    -C1 : The real part of the number */

  p_Z(cofactor_Z(A,minor_r,minor_c),5,0,5,0);printf("\n\n");
  f_mZ(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));

do
{
  fun(rp_I(5)+1);

} while(stop_w());

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


On calcul un cofacteur.



Exemple de sortie écran :
 A :
   -7   -1i    +2   +6i    +6   -1i    +4   -5i 
   +4   +2i    +8   -1i    -5   +8i    +2   -3i 
   +6   -5i    -1   -5i    -3   -3i    -9   +2i 
   -9   -3i    +8   +4i    -3   +8i    -5   -9i 

 cofactor(4,1) =  -406  -57i 


 Press return to continue
 Press X      to stop
Cet article est issu de Wikibooks. Le texte est sous licence Creative Commons - Attribution - Partage dans les Mêmes. Des conditions supplémentaires peuvent s'appliquer aux fichiers multimédias.