C++ Source: Definite Integral Calculation

I have recently been doing some research on flight and aerodynamics for a project that’s in the pipeline, in particular how to calculate lift under varying conditions. According to Wikipedia:

“The total Lift force is the integral of vertical pressure forces over the entire wetted surface area of the wing.”

This got me wondering about how to calculate the definite integral of a function programatically, so I wrote this program which aproximates the area under a curve to a given degree of accuracy by breaking the area up into a number of trapezoids.


Source: integral.cpp (3.0 KB)



This post is now [3 July 2008] the most popular on the whole blog. If you find it helpful (or not) please leave a comment. Thanks.


4 Responses to C++ Source: Definite Integral Calculation

  1. zach says:

    Thanks man, needed this for a side project, was looking for a library or something, but this is great.

  2. dan says:

    thanks implemented a length of curve function using your ideas it helped a bit to give me some ideas on how to integrate the sqrt() functions.

  3. Perfer not answer says:

    Thank you for the code. It helped me create a definite complex integral function.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: