@Override
    public void drawImage(Function f, MyPanel image, double x, double y) {
        Graphics g = image.getGraphics();
        Graphics2D g2 = (Graphics2D) g;
        g2.translate(150, 150);
        g2.scale(x, y);

        for (Line l : lines) {
            Complex tmp1 = f.evaluate(l.c1);
            int p = 10;
            for (int t = 0; t <= p; t++) {
                double re = ((p - t) * l.c1.getRe() / p + t * l.c2.getRe() / p);
                double im = ((p - t) * l.c1.getIm() / p + t * l.c2.getIm() / p);
                Complex tmp2 = f.evaluate(new Complex(re, im));
                Line tmpLine = new Line(tmp1, tmp2);
                tmpLine.paint(g2);
                tmp1 = tmp2;
            }
        }
    }