Area under curve, Mathematics

w/ You could use this sample code to test your C functions
// Please make appropriate changes to use this for C++.

// Following main function contains 3 representative test cases

int main() {
// test case 1
{
int noOfTerms = 2;
struct Term *equation = (struct Term*)malloc(sizeof(struct Term) * noOfTerms);
equation[0].exponent = 1;
equation[0].coefficient = 1;

equation[1].exponent = 2;
equation[1].coefficient = 3;

int limit1 = 4;
int limit2 = 8;

double usrout = getAreaUnderCurve(equation, noOfTerms, limit1, limit2);
printf("%lf", usrout);

}

// test case 2
{
int noOfTerms = 1;
struct Term *equation = (struct Term*)malloc(sizeof(struct Term) * noOfTerms);
equation[0].exponent =1;
equation[0].coefficient = 1;

int limit1 = 1;
int limit2 = 1;

double usrout = getAreaUnderCurve(equation, noOfTerms, limit1, limit2);
printf("%lf", usrout);

}

// test case 3
{
int noOfTerms = 1;
struct Term *equation = (struct Term*)malloc(sizeof(struct Term) * noOfTerms);
equation[0].exponent =1;
equation[0].coefficient = 1;

int limit1 = 2;
int limit2 = 1;

double usrout = getAreaUnderCurve(equation, noOfTerms, limit1, limit2);
printf("%lf", usrout);
}
}
Posted Date: 8/31/2012 1:07:21 AM | Location : United States







Related Discussions:- Area under curve, Assignment Help, Ask Question on Area under curve, Get Answer, Expert's Help, Area under curve Discussions

Write discussion on Area under curve
Your posts are moderated
Related Questions
how to find area under a curve?

Evaluate the linear equation: Solve the equation ax - b = c for x in terms of a, b, and c. Solution: Step 1. Using Axiom 1, add b to both sides of the equation. a

Illustration In a social survey whether the main reason was to establish the intelligence quotient or IQ of resident in a provided area, the given results were acquired as tab

how do you find the co=efficent when there are two brackets involved?


An $80.00 coat is marked down 20%. It does not sell, so the shop owner marks it down an additional 15%. What is the new price of the coat? Find out 20 percent of the original p

sketch the curve y=9-x2 stating the coordinates of the turning point and of the intersections with the axes.

Y=θ[SIN(INθ)+COS(INθ)],THEN FIND dy÷dθ. Solution)  Y=θ[SIN(INθ)+COS(INθ)] applying u.v rule then dy÷dθ={[ SIN(INθ)+COS(INθ) ] dθ÷dθ }+ {θ[ d÷dθ{SIN(INθ)+COS(INθ) ] }    => SI

Retail price index This is weighted average of price relatives based on an average household in the base year. The items consumed are divided into groups as liker food, transp

A national study found that treating people appropriately for high blood pressure decreased their overall mortality rate by 20%. Treating people adequately for hypertension has bee