Mathc complexes/Fichiers c : p m04

Un livre de Wikilivres.

Application

Installer et compiler ce fichier dans votre répertoire de travail.

p_m04.c
/* ------------------------------------ */
/*  Save as :   p_m04.c                 */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int r, int c)
{

double **A  = rE_mZ(i_mZ(r,c),99,1E-0);
int      Sn;

  for(Sn = c+C2; Sn<=S13; Sn++)
      {
       clrscrn();

       printf(" S%d spaces between each number\n\n",Sn);
  
       printf(" A : \n" );
       p_mZ(A, Sn,P0, S3,P0, C4);

       if(Sn!=S13)stop();
      }      
   
  f_mZ(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));
  
  do
        fun(rp_I(R5),rp_I(C5));

  while(stop_w());       

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


La fonction p_mZ(); a quatre paramètres. Le premier c'est la matrice. Le second contrôle l'espace laissé entre chaque nombre.

Si votre matrice est mal dessinée, c'est cette valeur qu'il faut en général augmenter.

Exemple de sortie écran :

6 spaces between each number

 A : 

   +62+28i    -43-85i    -81+28i     +8+56i 
   -65+54i    +80 +2i    +62-75i    +96-59i 
   +36+84i    -57+96i    -85-81i    -25-33i 
   +68+82i    -83+56i    -65+84i    -79-27i 

 Press return to continue. 

 7 spaces between each number

 A : 

    +62+28i     -43-85i     -81+28i      +8+56i 
    -65+54i     +80 +2i     +62-75i     +96-59i 
    +36+84i     -57+96i     -85-81i     -25-33i 
    +68+82i     -83+56i     -65+84i     -79-27i 

 Press return to continue. 

 8 spaces between each number

 A : 

     +62+28i      -43-85i      -81+28i       +8+56i 
     -65+54i      +80 +2i      +62-75i      +96-59i 
     +36+84i      -57+96i      -85-81i      -25-33i 
     +68+82i      -83+56i      -65+84i      -79-27i 

 Press return to continue. 

 9 spaces between each number

 A : 

      +62+28i       -43-85i       -81+28i        +8+56i 
      -65+54i       +80 +2i       +62-75i       +96-59i 
      +36+84i       -57+96i       -85-81i       -25-33i 
      +68+82i       -83+56i       -65+84i       -79-27i 

 Press return to continue.