import java.awt.*;
import java.applet.*;

public class Line3 extends Applet {

  int shape;

  public void init() {
    shape=0;
  }

 double f(double x) {
	return (Math.cos(x/5) + Math.sin(x/7) + 2) * getSize().height / 4;
 }

  public void paint (Graphics g)
  {
     for (int x = 0 ; x < getSize().width ; x++) {
	    g.drawLine(x, (int) f(x), x + 1, (int) f(x + 1));
     }
  }


    /**
     * Stop the insanity, um, applet.
     */
    public synchronized void stop() {
    }


    public String getAppletInfo() {
        return "A simple drawing program.";
    }

    public static void main(String args[]) {
      Frame f = new Frame("Line3");
     	Line3 line = new Line3();
    	line.init();
    	line.start();
      f.add("Center", line);
     	f.setSize(700,500);
    	f.show();
    }


}



