Mathc initiation/Fichiers h : c62fa


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)
{
tvalue t;

  t.value =	    PI/4.;
  t.min   =        0.; 
  t.max   =     2.*PI;  
  t.step  =       .05;  

CTRL_splot p;

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

 clrscrn();
 
 printf(" Let C be the curve consisting of all ordered pairs" 
        " (f(t),g(t)), with :\n\n" 
        " f : t-> %s  \n" 
        " g : t-> %s\n\n", feq, geq);

 printf(" With t = %0.3f, the equation of the tangent is :\n\n"
        " y =  ((Dg/Df)(t))(x-f(t))+g(t) = ",t.value);
        
 eq_Tan(f,g,DgDf,t.value);
 
 printf("\n\n\n");

 printf(" Find PB, the length of the tangent from P to the y axis.\n\n");
 
 printf(" P(%6.3f, %6.3f)    P(f(t), g(t))                 \n", 
        f(t.value),g(t.value));

 printf(" B(+0.000, %6.3f)    B(0, g(t)-f(t)*DgDf(t))\n\n\n",
          g(t.value)-f(t.value)*DgDf(t.value)); 

 printf(" PB =  sqrt(f(t)**2*(1+DgDf(t)**2))\n"  
        "    = %6.3f\n\n",
        sqrt(pow(f(t.value),2)*(1+pow(DgDf(t.value),2))));
                                                  
     G_TanLy(p,
             f,g,DgDf,
             t
            );

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

 return 0;
}
/* --------------------------------- */
/* --------------------------------- */
Find PB, the length of the tangent from P to the y axis with gnuplot and c language

Exemple de sortie écran :

 Let C be the curve consisting of all ordered pairs (f(t),g(t)), with :

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

 With t = 0.785, the equation of the tangent is :

 y =  ((Dg/Df)(t))(x-f(t))+g(t) =  -1.000*x +1.414


 Find PB, the length of the tangent from P to the y axis.

 P( 0.707,  0.707)    P(f(t), g(t))                 
 B(+0.000,  1.414)    B(0, g(t)-f(t)*DgDf(t))


 PB =  sqrt(f(t)**2*(1+DgDf(t)**2))
    =  1.000

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

 Press return to continue.