Aller au contenu

Mathc initiation/003u

Un livre de Wikilivres.


Sommaire

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

c00c2.c
/* --------------------------------- */
/* save as c00c2.c                   */
/* --------------------------------- */
#include  "x_afile.h"
#include      "fc2.h"
/* --------------------------------- */
int main(void)
{
double m =  J_wuv(             f,
                           X,  Y,  Z,
                           r0, r1, LOOP,
                           a0, a1, LOOP,
                           b0, b1, LOOP); 
 clrscrn();
 
 printf("  f :  x,y,z -> %s\n\n", feq);
 
 printf(" X  :  r,k,z -> %s       \tThe change of variables.\n",Xeq);
 printf(" Y  :  r,k,z -> %s                                 \n",Yeq);
 printf(" Z  :  r,k,z -> %s                               \n\n",Zeq);

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

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

 printf(" b1 :        -> %s                  \n",  b1eq);
 printf(" b0 :        -> %s         [0..PI]\n\n",  b0eq);
 
 printf("        (%s(%s(%s      \n",                    b1eq,a1eq,r1eq);
 printf(" m = int( int( int( f(X,Y,Z) [r**2 sin(b)] drdadb  = %.6f\n",m);
 printf("        (%s   (%s   (%s\n\n",                  b0eq,a0eq,r0eq);

 printf(" Code Mathematica : \n"
        " integral (r*cos(b))*(r**2 *sin(b)) dr da db"
        " from 0 to Pi/2 from 0 to (2*Pi)  from 0 to (1)\n\n");     
 stop();

 return 0;
}
/* --------------------------------- */
/* --------------------------------- */
a = xy;... ... b = zr;... ... r = r

Exemple de sortie écran :

  f :  x,y,z -> (z)

 X  :  r,k,z -> (r*sin(b)*cos(a))       	The change of variables.
 Y  :  r,k,z -> (r*sin(b)*sin(a))                                 
 Z  :  r,k,z -> (r*cos(b))                               

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

 a1 :      b -> 2 PI                  
 a0 :      b -> 0        [0..2PI]

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

        (PI/2(2 PI(1      
 m = int( int( int( f(X,Y,Z) [r**2 sin(b)] drdadb  = 0.785398
        (0   (0   (0

 Code Mathematica : 
 integral (r*cos(b))*(r**2 *sin(b)) dr da db from 0 to Pi/2 from 0 to (2*Pi)  from 0 to (1)

 Press return to continue.