Aller au contenu

Mathc initiation/a61a

Un livre de Wikilivres.


Sommaire

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

c00c2.c
/* ---------------------------------- */
/* save as c00c2.c                    */
/* ---------------------------------- */
#include "x_hfile.h"
#include     "fc2.h"
/* ---------------------------------- */
int main(void)
{
double Hx = simpson(hx,ax,bx,LOOP);
double Hy = simpson(hy,ay,by,LOOP);

 clrscrn();
 
 printf(" If the variables are separable,\n"
        " you can use the product of two simple integrals,\n"
        " instead of a double integral.\n\n See c00c.c\n\n\n");
        
 printf("          (%s\n"
        " Hx  = int(  (%s) * dx = %.6f\n"
        "          (%s\n\n",    bxeq, hxeq, Hx, axeq);

 printf("          (%s\n"
        " Hy  = int(  (%s) * dy = %.6f\n"
        "          (%s\n\n\n",  byeq, hyeq, Hy, ayeq);
        
printf(" The result is  Hx * Hy = %.6f.\n\n"
       " Verify with the file c00c.c   \n\n", Hx * Hy);
        
 stop();

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

Exemple de sortie écran :

 If the variables are separable,
 you can use the product of two simple integrals,
 instead of a double integral.

 See c00c.c


          (3
 Hx  = int(  (x**2) * dx = 9.000000
          (0

          (+PI
 Hy  = int(  (1) * dy = 6.283185
          (-PI


 The result is  Hx * Hy = 56.548668.

 Verify with the file c00c.c   

 Press return to continue.