TP Intégration Numérique
 All Files Functions
essai01.c
Go to the documentation of this file.
1 
8 #include <math.h>
9 
10 #include "mesh1D.h"
11 #include "quad.h"
12 #include "utils.h"
13 
14 double f(double x){
15  return 8.*sqrt(x*(1-x));
16 }
17 
18 int main(){
19  int n;
20  double *X,h;
21  printf("n=");scanf("%d",&n);
22  DisRegAlloc(0,1,n,&X,&h);
23  printf("h = %lf\n",h);
24  printDoubleDynArray(X,n,"X","%8.5lf",5);
25  printf("Int=%lf\n",quadPM(f,X,n,h));
26  Free(X);
27  return EXIT_SUCCESS; // return 0
28 }