import sk.uniba.fmph.pocprak.simplegraphics.*;
public class Pokus2 {

  public static void main(String[] args) {
    Killer.createKiller();

    Kreslic krxy = new Kreslic(new GrAxisX(0, 1, 0), new GrAxisY( -1., 1., 0));
    krxy.gr.setUserFrameSize(0.5, 0., 1., 1.);
    krxy.nakresliOsi();
    krxy.gr.repaint();
    Integrable f = new test();
    double L = 1.;
    Fourier fou = new Fourier(100,L);
    fou.makeTransform(f);
    for(double x=0; x<1.; x+=0.001){
      krxy.gr.drawPoint(x,fou.fcn(x));
    }
    krxy.gr.repaint();
  }

  private static class test implements Integrable{
    public double fcn(double x) {
      if (x < 0.2)return 2.*x;
      else return 0.5*(1. - x);
    }
  }

}
