Aller au contenu

Mathc initiation/a108

Un livre de Wikilivres.


Sommaire


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

c00a.c
/* --------------------------------- */
/* save as c00a.c                    */
/* --------------------------------- */
#include "x_hfile.h"
#include      "fa.h"
/* --------------------------------- */
int main(void)
{
CTRL_splot p;
tvalue     t;
double     n = 2*200;

  p.xmin = -1;
  p.xmax = +1;             
  p.ymin = -1;
  p.ymax = +1;
  	
  t.value =    2*PI;
  t.min   =      0.; 
  t.max   = t.value;  
  t.step  =      .1;  
  
double  m = CurveLength2d_simpson(f,g,t.min,t.max,n);

 clrscrn();

 printf(" r(t) = f(t)i + g(t)j \n\n");
 printf(" With \n\n");
 printf(" f : t-> %s  \n", feq);
 printf(" g : t-> %s\n\n", geq);
 printf(" %+.2f < t < %+.2f \n\n",t.min,t.max);

  G_Curve_2d(p,
             f,g,
             t
            );

 printf(" ... load \"a_main.plt\" ... with gnuplot.\n\n");
 
 stop(); 

 clrscrn();
 printf(" If a curve C has a smooth parametrization \n\n"
        "      f : t->  %s , g : t->  %s \n\n"
        " And if C does not intersect itself,\n"
        " except possibly for t= a and t = b,\n"
        " then the length L of C is        \n\n"
        "     / b\n"
        "    |   \n"
        "    |    [Df(t)^2+Dg(t)^2]^1/2 dt = %.7f\n"
        "    |   \n"
        "   /   a\n\n\n", feq, geq, m);

 stop(); 

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


Exemple de sortie écran :

 r(t) = f(t)i + g(t)j 

 With 

 f : t-> cos(t)  
 g : t-> sin(t)

 +0.00 < t < +6.28 

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

 Press return to continue.


Exemple de sortie écran :

 If a curve C has a smooth parametrization 

      f : t->  cos(t) , g : t->  sin(t) 

 And if C does not intersect itself,
 except possibly for t= a and t = b,
 then the length L of C is        

     / b
    |   
    |    [Df(t)^2+Dg(t)^2]^1/2 dt = 6.2831853
    |   
   /   a



 Press return to continue