Advertisement
Guest User

Untitled

a guest
May 17th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <cmath>
  2. #include <stdio.h>
  3.  
  4. double y(double x)
  5. {
  6. return sqrt(4 - (x*x));
  7. }
  8.  
  9. int main()
  10. {
  11. double h = 0.5, x0 = 0.0, x1 = 0.5, x2 = 1.0;
  12. double Derivative = 0.0;
  13. Derivative = (1 / (h*h))*(y(x0)*(2 * x0 - x1 - x1) - 2 * y(x1)*(2 * x0 - x1 - x1) + y(x1)*(2 * x0 - x1 - x1));
  14. printf("%f\n", Derivative);
  15.  
  16.  
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement