//linda cobb //winter 98-99 //gaussian quadratures using legendre polynomials //driver for gaussian rountine //http://www.timestocome.com #include #include extern double gauss (double low, double high, int points); double function(double u) { double b = 4.81; // return 1 + 2*value + 3*value*value; return(1/sqrt(1 - u*u/4 -u*b*b)); } void main (void) { int points; //number of points to calc integral at double answer; //calculated value of integral double a, b; //user input lower and upper limits of itegration //get input from user... how many points to calc printf("\npoint choices are: 2,4,6,8,10,14,16,20,24,28,32,40,48,64"); printf("\n Enter the number of points you wish to use -> "); scanf("%d", &points); printf("\n Enter the limits of integration.. lower => "); scanf("%lf", &a); printf("\n Enter the upper limit. upper => "); scanf("%lf", &b); gauss(a, b, points); }