Aller au contenu

Mathc initiation/0040

Un livre de Wikilivres.


Sommaire

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

c00b3.c
/* --------------------------------- */
/* save as c00b3.c                   */
/* --------------------------------- */
#include  "x_afile.h"
#include      "fb0.h"
#include      "fb3.h"
/* --------------------------------- */
int main(void)
{               // drdbda
double m = simpson_dzdydx( g,
                           r0, r1, LOOP,
                           b0, b1, LOOP,
                           a0, a1, LOOP);
                           
double M =   simpson_dydx( G,
                           R0, R1, LOOP,
                           B0, B1, LOOP); 
                          
 clrscrn();
 printf(" With spherical coordinates.\n\n");
 printf(" f   :   x,y,z -> %s                  \n",   feq);
 printf(" g   :   a,b,r -> %s                \n\n",   geq);

 printf(" r1  :     a,b -> %s                  \n",  r1eq);
 printf(" r0  :     a,b -> %s         [0..oo]\n\n",  r0eq);

 printf(" b1  :       a -> %s                  \n",  b1eq);
 printf(" b0  :       a -> %s         [0..PI]\n\n",  b0eq);

 printf(" a1  :         -> %s                  \n",  a1eq);
 printf(" a0  :         -> %s        [0..2PI]\n\n",  a0eq);

 printf("        (%s (%s   (%s      (dzdydx)\n",        a1eq,b1eq,r1eq);
 printf(" m = int( int(   int( g(a,b,r) drdbda = %.6f\n",m);
 printf("        (%s   (%s       (%s\n\n",              a0eq,b0eq,r0eq);

 printf("             (%s    (%s   (dydx)\n",                B1eq,R1eq);
 printf(" M = 2*PI int( int(  G(b,r) drdb = %.6f\n",2*PI*M);
 printf("             (%s       (%s\n\n",                    B0eq,R0eq);
 stop();
         
 return 0;
}
/* --------------------------------- */
/* --------------------------------- */
a = xy;... ... b = zr;... ... r = r

Exemple de sortie écran :

 With spherical coordinates.

 f   :   x,y,z -> (z cos(y))                  
 g   :   a,b,r -> (r cos(b)) [r**2 sin(b)]                

 r1  :     a,b -> 1                  
 r0  :     a,b -> 0         [0..oo]

 b1  :       a -> PI/2                  
 b0  :       a -> 0         [0..PI]

 a1  :         -> 2*Pi                  
 a0  :         -> 0        [0..2PI]

        (2*Pi (PI/2   (1      (dzdydx)
 m = int( int(   int( g(a,b,r) drdbda = 0.785398
        (0   (0       (0

             (PI/2    (1   (dydx)
 M = 2*PI int( int(  G(b,r) drdb = 0.785398
             (0       (0

 Press return to continue.