Click here to Skip to main content
15,912,072 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questiontoggle bits in a variable Pin
rupeshkp72815-Jun-10 21:29
rupeshkp72815-Jun-10 21:29 
AnswerRe: toggle bits in a variable Pin
OriginalGriff15-Jun-10 21:40
mveOriginalGriff15-Jun-10 21:40 
AnswerRe: toggle bits in a variable Pin
Cedric Moonen15-Jun-10 21:40
Cedric Moonen15-Jun-10 21:40 
QuestionLNK 2019 Pin
T.RATHA KRISHNAN15-Jun-10 21:21
T.RATHA KRISHNAN15-Jun-10 21:21 
AnswerRe: LNK 2019 Pin
Richard MacCutchan15-Jun-10 21:47
mveRichard MacCutchan15-Jun-10 21:47 
AnswerRe: LNK 2019 Pin
Aescleal16-Jun-10 7:02
Aescleal16-Jun-10 7:02 
QuestionIntegration in MFC Pin
Sakhalean15-Jun-10 21:18
Sakhalean15-Jun-10 21:18 
AnswerRe: Integration in MFC Pin
Cedric Moonen15-Jun-10 21:59
Cedric Moonen15-Jun-10 21:59 
Do you want to do the integration in real-time ? Is an approximation ok for you ?

There's an easy and quick way to make an integration, but it is an approximation (and the error margin depends on your sample rate and signal variation). If you remember that an integration of a signal is the calculation of the area under the curve of the signal, you can reach a good approximation by using an "average" method.
When you have two consecutive points of your signal, you will approximate the surface under those points by taking the average Y value and calculate the surface of the rectangle made by this Y and the X difference between the two points.

This looks like:

double dSurface = (Y2 + Y1)/2 * (X2 - X1);


You then need to add all these surface together to get an approximation of the total surface under the curve.
Cédric Moonen
Software developer

Charting control [v3.0]
OpenGL game tutorial in C++

GeneralRe: Integration in MFC Pin
Sakhalean15-Jun-10 23:05
Sakhalean15-Jun-10 23:05 
AnswerRe: Integration in MFC Pin
goorley15-Jun-10 22:01
goorley15-Jun-10 22:01 
Questionstd string mid function Pin
gmallax15-Jun-10 21:17
gmallax15-Jun-10 21:17 
AnswerRe: std string mid function Pin
Nuri Ismail15-Jun-10 21:25
Nuri Ismail15-Jun-10 21:25 
QuestionTeeChart Pro AX v6 Pin
eyalle15-Jun-10 20:19
eyalle15-Jun-10 20:19 
QuestionRead File Pin
MsmVc15-Jun-10 19:49
MsmVc15-Jun-10 19:49 
AnswerRe: Read File Pin
«_Superman_»15-Jun-10 20:37
professional«_Superman_»15-Jun-10 20:37 
GeneralRe: Read File Pin
MsmVc15-Jun-10 20:39
MsmVc15-Jun-10 20:39 
GeneralRe: Read File Pin
Nuri Ismail15-Jun-10 20:45
Nuri Ismail15-Jun-10 20:45 
AnswerRe: Read File Pin
Nuri Ismail15-Jun-10 20:43
Nuri Ismail15-Jun-10 20:43 
JokeRe: Read File Pin
«_Superman_»15-Jun-10 20:49
professional«_Superman_»15-Jun-10 20:49 
Questionunhandled win32 exception occurred..?? Pin
krishnaram_198315-Jun-10 19:34
krishnaram_198315-Jun-10 19:34 
AnswerRe: unhandled win32 exception occurred..?? Pin
Cedric Moonen15-Jun-10 20:13
Cedric Moonen15-Jun-10 20:13 
GeneralRe: unhandled win32 exception occurred..?? Pin
Niklas L15-Jun-10 20:25
Niklas L15-Jun-10 20:25 
AnswerRe: unhandled win32 exception occurred..?? Pin
_AnsHUMAN_ 16-Jun-10 0:27
_AnsHUMAN_ 16-Jun-10 0:27 
AnswerRe: unhandled win32 exception occurred..?? Pin
Aescleal16-Jun-10 6:54
Aescleal16-Jun-10 6:54 
QuestionHow to play Windows Media Player in VC++.NET Pin
shiv@nand15-Jun-10 19:31
shiv@nand15-Jun-10 19:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.