Aller au contenu

Mathc initiation/Fichiers h : c39fa

Un livre de Wikilivres.


Sommaire


Installer ce fichier dans votre répertoire de travail.

Les fonctions f(x)
fa.h
/* ---------------------------------- */
/* save as fa.h                       */
/* ---------------------------------- */
double f(
double x)
{
        return(x + 1.);
}
char  feq[] = "x + 1.";
/* ---------------------------------- */
double Df(
double x)
{
         return(1.);
}
char  Dfeq[] = "1.";
/* ---------------------------------- */
double ArcLength(
double x)
{
     return(  sqrt(1. + pow(Df(x),2)) );
}
/* ---------------------------------- */
/* ---------------------------------- */
fb.h
/* ---------------------------------- */
/* save as fb.h                       */
/* ---------------------------------- */
double f(
double x)
{
        return(x*x);
}
char  feq[] = "x**2";
/* ---------------------------------- */
double Df(
double x)
{
         return(2.*x);
}
char  Dfeq[] = "2.*x";
/* ---------------------------------- */
double ArcLength(
double x)
{
     return(  sqrt(1. + pow(Df(x),2)) );
}
/* ---------------------------------- */
/* ---------------------------------- */
fc.h
/* ---------------------------------- */
/* save as fc.h                       */
/* ---------------------------------- */
double f(
double x)
{
        return(sin(x));
}
char  feq[] = "sin(x)";
/* ---------------------------------- */
double Df(
double x)
{
         return(cos(x));
}
char  Dfeq[] = "cos(x)";
/* ---------------------------------- */
double ArcLength(
double x)
{
     return(  sqrt(1. + pow(Df(x),2)) );
}
/* ---------------------------------- */
/* ---------------------------------- */
fd.h
/* ---------------------------------- */
/* save as fd.h                       */
/* ---------------------------------- */
double f(
double x)
{
        return(log(x));
}
char  feq[] = "log(x)";
/* ---------------------------------- */
double Df(
double x)
{
         return(1./x);
}
char  Dfeq[] = "1./x";
/* ---------------------------------- */
double ArcLength(
double x)
{
     return(  sqrt(1. + pow(Df(x),2)) );
}
/* ---------------------------------- */
/* ---------------------------------- */