Guest User

Untitled

a guest
Jan 17th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. double a = System::Convert::ToDouble(this->textBox3->Text);  
  2.         double b = System::Convert::ToDouble(this->textBox4->Text);
  3.         double eps = (System::Convert::ToDouble(this->trackBar1->Value))*0.0001;
  4.         double x = System::Convert::ToDouble(this->textBox5->Text);
  5.         int n = 2;
  6.         double step;
  7.         double x1 = a, x2, x3, Fy,F1y;
  8.         do
  9.         {
  10.             step = (b-a)/n;
  11.             x2 = a + step;
  12.             x3 = x2 + step;
  13.             Fy = (y(x2) - y(x1))/(x2 - x1);
  14.             F1y = (y(x3) - y(x2))/(x3 - x2);
  15.         }
  16.         while(fabs((F1y - Fy)) > eps);
  17.         double dif = (y(x + step) - y(x))/((x+step) - x);
  18.             this->label13->Text = System::Convert::ToString(dif);
Add Comment
Please, Sign In to add comment