Aller au contenu

Mathc initiation/004b

Un livre de Wikilivres.


Sommaire

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

c0b6.c
/* --------------------------------- */
/* save as c0b6.c                    */
/* --------------------------------- */
#include   "x_afile.h"
#include        "fb.h"
/* --------------------------------- */
int main(void)
{
CTRL_splot w;
		
w.xmin  = -0.,  w.xmax    =  3.;
w.ymin  = -0.,  w.ymax    =  3.;
w.zmin  = -0.,  w.zmax    =  5.;
w.rot_x = 55.,  w.rot_z   = 57.;
w.scale =  1.,  w.scale_z =  1.;

double  Mass =  simpson_dzdydx(R, z0,z1,LOOP, y0,y1,LOOP, x0,x1,LOOP);

double  Mxy =  simpson_dzdydx( zR, z0,z1,LOOP, y0,y1,LOOP, x0,x1,LOOP);
double  Mzx =  simpson_dzdydx( yR, z0,z1,LOOP, y0,y1,LOOP, x0,x1,LOOP);
double  Mzy =  simpson_dzdydx( xR, z0,z1,LOOP, y0,y1,LOOP, x0,x1,LOOP);

   pt3d XYZ =  i_pt3d(Mzy/Mass, Mzx/Mass, Mxy/Mass);

 clrscrn();
 
 printf(" The function of density is :\n\n"
        " R : x,y,z  -> %.0f\n\n", R(0,0,0));

 printf(" f  : x,y,z -> %s\n\n",  feq);
 printf(" z1 : x,y   -> %s  \n", z1eq);
 printf(" z0 : x,y   -> %s\n\n", z0eq);
  
 printf(" y1 : x     -> %s  \n", y1eq);
 printf(" y0 : x     -> %s\n\n", y0eq);

 printf(" x1 :       -> %s  \n", x1eq); 
 printf(" x0 :       -> %s\n\n", x0eq);

 printf(" Draw the center of mass :\n\n");
 printf(" X = Mzy/Mass = %.2f\n"  
        " Y = Mzx/Mass = %.2f\n" 
        " Z = Mxy/Mass = %.2f\n\n",
          Mzy/Mass, Mzx/Mass, Mxy/Mass);
          
  G_cmass(   w,
           z1eq,
           XYZ);        
 stop();
 
 return 0;
}
/* --------------------------------- */
/* --------------------------------- */

Exemple de sortie écran :

 The function of density is :

 R : x,y,z  -> 1

 f  : x,y,z -> 1

 z1 : x,y   -> (+cos(x)*sin(y) + 4)  
 z0 : x,y   -> 0

 y1 : x     -> +3  
 y0 : x     -> -0

 x1 :       -> +3  
 x0 :       -> -0

 Draw the center of mass :

 X = Mzy/Mass = 1.40
 Y = Mzx/Mass = 1.50
 Z = Mxy/Mass = 2.05

 ... load "a_main.plt" ... with gnuplot.

 Press return to continue.