Aller au contenu

Mathc initiation/a352

Un livre de Wikilivres.


Sommaire


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

c00a4.c
/* ---------------------------------- */
/* save as c00a4.c                    */
/* ---------------------------------- */
#include  "x_hfile.h"
#include       "fa.h"
/* ---------------------------------- */
int main(void)
{
double c=.5;

CTRL_splot w;

w.xmin = -2.0; w.xmax = +4.0,
w.ymin = -1.0; w.ymax = +2.0;

 clrscrn();
 
 printf("  f : x-> %s\n\n",   feq);
 printf("  Df: x-> %s\n\n\n",Dfeq);

 printf(" With c = %0.3f, the equation of the tangent is :\n\n",c);
 printf("        y = Df(c) (x-c) + f(c) = ");
 
 eq_Tan(  c,
          f,Df);

 printf("\n\n\n"
        " Find PB, the length of the tangent from P to the y axis.\n\n\n");

 printf(" P(%6.3f, %6.3f)            P(c, f(c))         \n", 
        c, f(c));

 printf(" B( 0,     %6.3f)            B(0, f(c)-c*Df(c))\n\n\n", 
        f(c)-c*Df(c));

 printf(" PB = sqrt(c**2*(1+Df(c)**2)) = %6.3f \n\n\n", 
 sqrt(c*c*(1+pow(Df(c),2))));
                         
  G_TanPy      ( w,     
                 c,
                 f,feq,Df);

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

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


Résultat dans gnuplot
Tangente07


Exemple de sortie écran :
  f : x->  cos(x)

  Df: x->  (-sin(x)) 


 With c = 0.500, the equation of the tangent is :

        y = Df(c) (x-c) + f(c) =  -0.479*x +1.117


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


 P( 0.500,  0.878)            P(c, f(c))         
 B( 0,      1.117)            B(0, f(c)-c*Df(c))


 PB = sqrt(c**2*(1+Df(c)**2)) =  0.554 


 Open the file ... load "a_main.plt" ... with gnuplot.

 Press return to continue.