« Mathc gnuplot/Application : Tangente de P à l'axes des y » : différence entre les versions

Contenu supprimé Contenu ajouté
Automatique : Mise à jour de la navigation entre les chapitres
Aucun résumé des modifications
Ligne 8 :
= Préambule =
 
* La tangente dans [[w:Tangente (géométrie)|Wikipedia]] et dans Wikiversité [[v:Mathc Home Edition c03|Mathc Home Edition c03]], une approche empirique.
* Dans Wikiversité [[v:Mathc Home Edition c03|Mathc Home Edition c03]], une approche empirique.
 
 
= Présentation =
 
* '''N'oubliez pas les fichiers *.h partagés et ceux de ce chapitre.'''
* Un exemple à tester
* '''N'oubliez pas les fichiers *.h partagés et ceux de ce chapitre.'''
 
 
=== Dessiner ===
 
* {{Fichier|c01.c|largeur=70%|info=Calculer la longeur de P(c,f(c) à l'axe de y.|icon=Crystal Clear mimetype source c.png}}
 
<source lang="c">
/* ------------------------------------ */
Ligne 91 ⟶ 88 :
== Les fichiers h de ce chapitre ==
 
=== Appel des fichiers standards ===
 
{{Fichier|x_ahfile.h|largeur=70%|info=Appel des fichiers|icon=Crystal Clear mimetype source h.png}}
<source lang="c">
/* ------------------------------------ */
Ligne 113 ⟶ 111 :
=== La fonction à dessiner ===
 
{{Fichier|f2.h|largeur=70%|info=La fonction à dessiner|icon=Crystal Clear mimetype source h.png}}
<source lang="c">
/* ------------------------------------ */
Ligne 135 ⟶ 134 :
=== Equation de la tangente ===
 
{{Fichier|k_tan.h|largeur=70%|info=Equation de la tangente|icon=Crystal Clear mimetype source h.png}}
<source lang="c">
/* ------------------------------------ */
Ligne 176 :
=== La fonction graphique ===
 
{{Fichier|kg_tan.h|largeur=70%|info=La fonction graphique|icon=Crystal Clear mimetype source h.png}}
<source lang="c">
/* ------------------------------------ */
Ligne 188 ⟶ 189 :
)
{
FILE *fp = fopen("a_main.plt","w");
FILE *ft = fopen("a_yaxe.plt","w");
 
fp = fopen("a_main.plt","w");
fprintf(fp," set zeroaxis\n\n"
" plot [%0.3f:%0.3f] [%0.3f:%0.3f] \\\n"
Ligne 202 ⟶ 203 :
fclose(fp);
 
FILE *ft fp = fopen("a_yaxe.plt","w");
fprintf(ft," %0.5f %0.5f\n",c,((*P_f)(c)));
fprintf(ftfp," %0.0005f %0.5f\n", c,((*P_f)(c)));
fprintf(ftfp," %0.5f000 %0.5f\n",c,((*P_f)(c)));
((*P_f)(c))-(((*PDf)(c))*c));
fclose(ftfp);
}
</source>
 
 
==Même Exempleexemple avec sortiela fichierfonction ==sin.
 
* Dans cet exemple la sortie texte ce fait dans un fichier.
 
<source lang="c">
/* ------------------------------------ */
/* Save as : c01f.c */
/* ------------------------------------ */
#include "x_ahfile.h"
#include "f2.h"
/* ------------------------------------ */
int main(void)
{
FILE *fp = fopen("a_out.txt","w");
double c = .5;
 
fprintf(fp," f : x-> %s \n", feq);
fprintf(fp," Df: x-> %s\n\n",Dfeq);
 
fprintf(fp," With c = %0.3f, the equation of the tangent is :\n\n"
" y = Df(c) (x-c) + f(c) = ",c);
eq_Tanf(fp,c,f,Df);
 
fprintf(fp," Find PB, the length of the tangent from P to the y axis.\n\n");
 
fprintf(fp," P(%5.3f, %5.3f) P(c, f(c)) \n",
c, f(c));
 
fprintf(fp," B(0.000, %5.3f) B(0, f(c)-c*Df(c))\n\n",
f(c)-c*Df(c));
 
fprintf(fp," PB = sqrt(c**2*(1+Df(c)**2)) = %6.3f \n\n",
sqrt(c*c*(1+pow(Df(c),2))));
 
G_TanPy (i_WGnuplot(-2,4,-1,2),
c,
feq,f,Df);
 
fprintf(fp," load \"a_main.plt\" with gnuplot.");
fclose(fp);
 
printf(" Read \"a_out.txt\".\n"
" Press return to continue");
 
getchar();
 
return 0;
}
</source>
 
* Même exemple avec la fonction sin.
 
{| class="wikitable"