By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,641 Members | 2,085 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,641 IT Pros & Developers. It's quick & easy.

area under the curve

P: 1
hello,
i am using Visual studio environment to run GUI in c#, which is connecting to a Micro controller via Rs232, the problem is i am getting a wave on GUI (sometimes multiple waves)(using A/D converter), and i want to calculate the area under the curve in simple words consider i am getting a sine wave and on that wave i want to calculate the area from point X1 to X2. any suggestions will be appreciated, i am also attaching a code where i read strings form micro controller and display them on Gui.

public delegate void AddnewText(string str);
public void AddTextToLabel(string str)
{
if (this.tb_Received.InvokeRequired)
{
if (str.IndexOf(".", 2)>1) str = str.Substring(0, str.IndexOf(".", 2));
this.Invoke(new AddnewText(AddTextToLabel), str);

//MessageBox.Show("invoked");

}


else
{
if (str != "\f")
{
this.tb_Received.Text = "";
this.tb_Received.Text += str;
string a = str;
input = Convert.ToDouble(str);

// this.tb_Received.Text += input;

// double[] intArray;
// intArray = new double [200];
//intArray[p] = input;
CreateChart(zedGraphControl1);
p++;
}
else
{
this.tb_Received.Text = "";
}
}
}
Apr 11 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.