Aller au contenu

Mathc initiation/c33bb

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.value =	  3*PI/4.;
  t.min   =        0.; 
  t.max   =     2.*PI;  
  t.step  =       .05;  

CTRL_splot p;

  p.xmin = -3;
  p.xmax =  3;             
  p.ymin = -2;
  p.ymax =  2;
 
 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 PA, the length of the tangent from P to the x axis.\n\n");
 
 printf(" P(%6.3f, %6.3f)    P(f(t), g(t))                 \n", 
        f(t.value),g(t.value));

 printf(" A(%6.3f,  0.000)    A(f(t)-g(t)/(DgDf)(t), 0)\n\n\n",
          f(t.value)-g(t.value)/(DgDf)(t.value)); 

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

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

 return 0;
}
/* --------------------------------- */
/* --------------------------------- */
Find PA, the length of the tangent from P to the x axis in language c with gnuplot

Exemple de sortie écran :

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

 f : t-> 3*pow(sin(t),5)  
 g : t-> 3*pow(cos(t),5)

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

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


 Find PA, the length of the tangent from P to the x axis.

 P( 0.530, -0.530)    P(f(t), g(t))                 
 A( 1.061,  0.000)    A(f(t)-g(t)/(DgDf)(t), 0)


 PA =  sqrt( g(t)**2 * (1/(DgDf(t)**2) + 1) )
    =  0.750

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

 Press return to continue.