Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cmath>
- #include <stdio.h>
- double y(double x)
- {
- return sqrt(4 - (x*x));
- }
- int main()
- {
- double h = 0.5, x0 = 0.0, x1 = 0.5, x2 = 1.0;
- double Derivative = 0.0;
- Derivative = (1 / (h*h))*(y(x0)*(2 * x0 - x1 - x1) - 2 * y(x1)*(2 * x0 - x1 - x1) + y(x1)*(2 * x0 - x1 - x1));
- printf("%f\n", Derivative);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement