 import java.io.*;

abstract class f_xy
{
  //single function single independent variable
  // example f=x*x
  abstract double func(double x,double y);
}

class fxy extends f_xy
{ //diferansiyeli alınan fonksiyon
  public double func(double x,double y)
  {return x*y;}
}

class fxyKC extends f_x
{ //Gerçek çözüm fonksiyonu
  public double func(double x)
  {return Math.exp(x*x/2.0);}
}

class dif1
{ 
  public static void main(String args[]) throws IOException
  {
   double x0=0;
   double y0=1.0;
   double xn=1.0;
   fxy f1=new fxy();
   fxyKC f2=new fxyKC();
   Runge_Kutta rk=new Runge_Kutta("RKV9");
   System.out.println(rk.toString());
   double XY[][]=rk.hesapla(f1,x0,xn,y0,0.01);
   System.out.println(Matrix.toString(Matrix.Transpose(XY)));
   Plot p1=new Plot(XY);
   p1.addSpline(XY,10);
   p1.addFunction(f2,x0,xn,200);
   p1.setPlotType(0,24);
   //p1.setPlotType(1,0);
   p1.plot();
  }
}
