Aller au contenu

Mathc initiation/a205

Un livre de Wikilivres.


Sommaire


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

c00b.c
/* ------------------------------------ */
/*  Save as :   c00b.c                  */
/* ------------------------------------ */
#include  "x_hfile.h"
#include       "fb.h"
/* ------------------------------------ */
int main(void)
{
tvalue t;

  t.min   =        0.; /* a */
  t.max   =        PI; /* b */ 
  t.step  =       0.1;  

CTRL_splot p;

  p.xmin = -2;
  p.xmax =  2;             
  p.ymin = -2;
  p.ymax =  2;	

 double sector =  2.5;
 int    n      = 2*50;	

 clrscrn();
 printf(" If r is continuous on [a,b],               \n\n" 
        "        where 0 <= a  < b <= 2Pi,           \n\n" 
        " then the area A of the region bounded by the \n" 
        " graphs of r  with t = a and t = b is       \n\n" 
        "       / b                                    \n" 
        "      |                                       \n" 
        " A =  |   1/2 r(t)^2 dt                       \n" 
        "      |                                       \n"
        "     /   a                                \n\n\n");
 stop();

 clrscrn();

 printf(" r : t-> %s\n\n", req);

      G_polar_areaf(
              p,
              r,
              t,
              sector
            );

 printf(" Draw a typical circular sector.\n\n");
 printf(" ... load \"a_main.plt\" ... with gnuplot.  \n\n");

 printf(" Express the area of the sector as :\n\n");
 printf(" radius             : %s\n",req);
 printf(" angle              : dt\n\n");
 printf(" Area of the sector : 1/2 (%s)^2 dt\n",req);
 printf("\n");
 stop();

 clrscrn();
 printf(" If we apply \n\n\n");
 printf("     / %.2f\n",t.max);
 printf("    |  \n");
 printf("    |  \n");
 printf("   /   %.2f\n\n\n",t.min);
 printf(" to  :  1/2 (%s)^2 dt\n\n\n",req);
 printf(" We obtain the area of the region Rt.\n\n");

 printf("     / %.2f\n",t.max);
 printf("    |  \n");
 printf("    |     1./2.*(%s)^2 dt = %.6f\n",
                  req,simpson(SectorArea,t.min,t.max,n));
 printf("    |  \n");
 printf("   /   %.2f\n\n\n",t.min);

 stop();

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


Exemple de sortie écran :

  If r is continuous on [a,b],               

        where 0 <= a  < b <= 2Pi,           

 then the area A of the region bounded by the 
 graphs of r  with t = a and t = b is       

       / b                                    
      |                                       
 A =  |   1/2 r(t)^2 dt                       
      |                                       
     /   a                                


 Press return to continue.
The area A of the region bounded by the graphs of r = 2*cos(t) with gnuplot

Exemple de sortie écran :

 r : t-> 2*cos(t)

 Draw a typical circular sector.

 To see the graph, open the file "a_main.plt" with Gnuplot.


 Express the area of the sector as :

 radius             : 2*cos(t)
 angle              : dt

 Area of the sector : 1/2 (2*cos(t))^2 dt

 Press return to continue.


Exemple de sortie écran :

 If we apply 


     / 3.14
    |  
    |  
   /   0.00


 to  :  1/2 (2*cos(t))^2 dt


 We obtain the area of the region Rt.

     / 3.14
    |  
    |     1./2.*(2*cos(t))^2 dt = 3.141593
    |  
   /   0.00


 Press return to continue.