Mathc initiation/a292
Installer et compiler ces fichiers dans votre répertoire de travail.
c01a.c |
---|
/* --------------------------------- */
/* save as c01a.c */
/* --------------------------------- */
#include "x_hfile.h"
#include "fa.h"
/* --------------------------------- */
int main(void)
{
CTRL_splot w = i_ctrl_splot(0,2,0,2, 0,0, 0,0, 0,0);
pt2d d = i_pt2d(0.025,0.025);
double step = .01;
clrscrn();
printf(" Verify that f(x) >= 0 on [%.3f,%.3f].\n\n", ax, bx);
printf(" f : x-> %s\n\n", veq);
G_f_ab(w,
ax,bx,
veq,v);
stop();
clrscrn();
printf(" Draw a typical vertical rectangle.\n\n");
printf(" The length of the rectangle is : %s \n", veq);
printf(" The width of the rectangle is : dx \n" );
printf(" The Area of the rectangle is : (%s) * dx\n", veq);
printf(" \n\n\n\n\n");
G_f(w,
ax,bx,
d,
step,
v);
stop();
clrscrn();
printf(" If we apply \n\n\n");
printf(" (%.3f\n", bx);
printf(" int( \n");
printf(" (%.3f\n\n\n", ax);
printf(" to : (%s) * dx\n\n\n", veq);
printf(" We obtain a limit of sums of areas of vertical rectangles.\n\n\n");
printf(" (%.3f\n", bx);
printf(" int( (%s) * dx = %.6f\n", veq, simpson(v, ax,bx,LOOP));
printf(" (%.3f\n\n\n", ax);
stop();
return 0;
}
/* --------------------------------- */
/* --------------------------------- */
Exemple de sortie écran :
If we apply
(1.000
int(
(0.200
to : (sqrt(x)) * dx
We obtain a limit of sums of areas of vertical rectangles.
(1.000
int( (sqrt(x)) * dx = 0.607038
(0.200
Press return to continue.