Aller au contenu

Mathc initiation/c34a4

Un livre de Wikilivres.


Sommaire

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

c00b.c
/* ---------------------------------- */
/* save as c00b.c                     */
/* ---------------------------------- */
#include "x_afile.h"
#include      "fb.h"
/* ---------------------------------- */
int main(void)
{
 clrscrn();
 
 printf(" g : (x,y)-> %s\n\n", geq);
 printf(" v :   (y)-> %s  \n", veq);
 printf(" u :   (y)-> %s\n\n", ueq);
 printf(" b =    %+.1f\n a =    %+.1f\n\n\n",b,a);

 printf(" Find the surface area for the given functions\n");
 printf(" with the simpson's rule.\n\n\n");
 printf("    (b     (v(y)\n");
 printf(" int(   int(     sqrt(g_x()**2 + g_y()**2 + 1)  dxdy = %.3f\n", 
                                             S_dxdy(g, u,v,LOOP, a,b,LOOP));
 printf("    (a     (u(y)\n\n\n");

 stop();

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


Exemple de sortie écran :

 g : (x,y)-> x**2 + y

 v :   (y)-> 1  
 u :   (y)-> 0

 b =    +1.0
 a =    -1.0


 Find the surface area for the given functions
 with the simpson's rule.


    (b     (v(y)
 int(   int(     sqrt(g_x()**2 + g_y()**2 + 1)  dxdy = 3.596
    (a     (u(y)




 Press return to continue.


Exemple de sortie écran :

Verify with maple

> restart:
> 
> g := (x,y)->x^2+y:
> Int(
> Int(
> 
> sqrt( diff(g(x,y),x)^2 + diff(g(x,y),y)^2 + 1),
> 
> x = 0 .. 1),
> y = -1 .. 1);

                       1    1
                      /    /
                     |    |           2
                     |    |   sqrt(4 x  + 2) dx dy
                     |    |
                    /    /
                      -1   0

> evalf(value(%));
> 

                             3.595705578