Mathc initiation/Fichiers c : c23cc
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c3c.c |
---|
/* --------------------------------- */
/* save as c3c.c */
/* --------------------------------- */
#include "x_hfile.h"
#include "fc.h"
/* --------------------------------- */
int main(void)
{
double c = 1.;
clrscrn();
printf(" f : x-> %s\n\n"
" Df : x-> %s\n\n\n", feq, Dfeq);
printf(" Compute the derivative of f when x = %0.3f\n\n", c);
printf(" with Df(%0.3f) = %0.8f \n",c, Df(c));
printf(" with fx_x(%0.3f) = %0.8f\n\n\n",c, fx_x(f,c,H));
stop();
clrscrn();
printf(" The equation of the tangente \n\n");
eq_Tan(c, f, Df);
printf(" The equation of the tangente (with the function : fx_x();)\n\n");
eq_tan(c, f);
stop();
clrscrn();
printf(" The equation of the normal \n\n");
eq_Norm(c, f, Df);
printf(" The equation of the normal (with the function : fx_x();)\n\n");
eq_norm(c, f);
stop();
return 0;
}
/* ---------------------------------- */
/* ---------------------------------- */
Vérifions notre travail avec gnuplot.
Fichier de commande gnuplot :
# ---------------------
# Copy and past this file into the screen of gnuplot
#
#
set zeroaxis lt 3 lw 1
set grid
plot [ -10.:10.] [-5.:5.]\
x*sin(cos(x)),\
-0.207*x +0.722,\
4.826*x -4.312
reset
# ---------------------
Exemple de sortie écran :
f : x-> x*sin(cos(x))
Df : x-> sin(cos(x))-x*cos(cos(x))*sin(x)
Compute the derivative of f when x = 1.000
with Df(1.000) = -0.20721089
with fx_x(1.000) = -0.20721089
Press return to continue.
**************************
The equation of the tangente
-0.207*x +0.722
The equation of the tangente (with the function : fx_x();)
-0.207*x +0.722
Press return to continue.
*************************
The equation of the normal
4.826*x -4.312
The equation of the normal (with the function : fx_x();)
4.826*x -4.312
Press return to continue.