using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _09_Rozniczkowanie
{
  public delegate double Funkcja(double x);

  public class Differentator
  {

    public double h;
    public Funkcja f;

    public double Regr(double x)
    {
      return (f(x) - f(x - h)) / h;
    }

    public double Prog(double x)
    {
      return (f(x + h) - f(x)) / h;
    }

    public double Cent(double x)
    {
      return (f(x + h) - f(x - h)) / (2 * h);
    }

    public double Prec(double x)
    {
      return (-f(x + 2 * h) + 8 * f(x + h) - 8 * f(x - h) + f(x - 2 * h)) / (12 * h);
    }

  }
}
