Aller au contenu

Mathc initiation/a221

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)
{
double     n = 2*200;

CTRL_splot p;

  p.xmin = -4;
  p.xmax = +2;             
  p.ymin = -3;
  p.ymax = +3;

tvalue t;
  	
  t.min   =  PI/2; 
  t.max   =  PI+1;  
  t.step  =    .1;  

tvalue c; 
 	
  c.min   =    0.; 
  c.max   =  2*PI; 
  c.step  =    .1;
      
double  m = CurveLength2d_simpson(f,g,t.min,t.max,n);

 clrscrn();
 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,
             c,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"
        " with a = %f\n" 
        "      b = %f\n\n\n", feq, geq, 
                                     m,
                           t.min,t.max);
        
    G_length(p,
             f,g,
             t
            );

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

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



If a curve C has a smooth parametrization with gnuplot in c language

Exemple de sortie écran :

 With 

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

 +1.57 < t < +4.14 

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

 Press return to continue.


Exemple de sortie écran :

 If a curve C has a smooth parametrization 

      f : t->  2*cos(t)-cos(2*t) , g : t->  2*sin(t)-sin(2*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 = 9.4922585
    |   
   /   a


 with a = 1.570796
      b = 4.141593


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

 Press return to continue.