Mathc initiation/c33cc

Un livre de Wikilivres.


Sommaire


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


c00c.c
/* --------------------------------- */
/* save as c00c.c                    */
/* --------------------------------- */
#include "x_hfile.h"
#include      "fc.h"
/* --------------------------------- */
int main(void)
{
double ny = 2*150, nx = 2*150,       
       M = 0;
  
 clrscrn();
 printf(" f  : (x,y)-> %s  \n\n",  feq);
 printf(" bx :   (y)-> %s   \n", bxeq);
 printf(" ax :   (y)-> %s \n\n", axeq);

 printf(" by :         %s    \n", byeq);
 printf(" ay :         %s\n\n\n", ayeq);

 M = trapezoid_dxdy(f, ax,bx,nx, ay,by,ny);

 printf(" With the trapezoidal's rule.\n\n");
 printf("    (%.3f  (%s\n",      by,bxeq);
 printf(" int(    int(       %s  dx dy = %.6f\n", feq, M);
 printf("    (%.3f  (%s\n\n\n",  ay,axeq);

 stop();

 return 0;
}
/* --------------------------------- */
/* --------------------------------- */
 Même résultat que la version avec l'algorithme de Simpson à quelques décimales près.

Exemple de sortie écran :

 f  : (x,y)-> x**3+4*y  

 bx :   (y)-> sqrt(y)   
 ax :   (y)-> y/2. 

 by :         4    
 ay :         0


 With the trapezoidal's rule.

    (4.000  (sqrt(y)
 int(    int(       x**3+4*y  dx dy = 10.666577
    (0.000  (y/2.


 Press return to continue.