Aller au contenu

Mathc initiation/a351

Un livre de Wikilivres.


Sommaire


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

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

CTRL_splot w;

w.xmin = -2.0; w.xmax = +3.0,
w.ymin = -9.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 at c = %0.3f\n\n",c);
 printf(" the intersection points of the tangent with the x-y axis.\n\n\n");

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

 printf(" A(%6.3f, 0)               A(c-f(c)/Df(c), 0)\n",
        c-(f(c))/(Df(c)));

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

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

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



Exemple de sortie écran :
  f : x-> 3.0*x**2 - 2.0*x - 5.0

 Df : x-> 6.0*x - 2.0


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

       y =  Df(c) (x-c) + f(c) =  4.000*x -8.000


 Find at c = 1.000

 the intersection points of the tangent with the x-y axis.


 P( 1.000, -4.000)          P(c, f(c))
 A( 2.000, 0)               A(c-f(c)/Df(c), 0)
 B( 0, -8.000)              B(0, f(c)-c Df(c))


 With gnuplot... load "a_main.plt"

 Press return to continue.