area under the curve

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RAZA1
    New Member
    • Apr 2008
    • 1

    #1

    area under the curve

    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(stri ng str);
    public void AddTextToLabel( string str)
    {
    if (this.tb_Receiv ed.InvokeRequir ed)
    {
    if (str.IndexOf(". ", 2)>1) str = str.Substring(0 , str.IndexOf("." , 2));
    this.Invoke(new AddnewText(AddT extToLabel), str);

    //MessageBox.Show ("invoked");

    }


    else
    {
    if (str != "\f")
    {
    this.tb_Receive d.Text = "";
    this.tb_Receive d.Text += str;
    string a = str;
    input = Convert.ToDoubl e(str);

    // this.tb_Receive d.Text += input;

    // double[] intArray;
    // intArray = new double [200];
    //intArray[p] = input;
    CreateChart(zed GraphControl1);
    p++;
    }
    else
    {
    this.tb_Receive d.Text = "";
    }
    }
    }
Working...