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

public class Line4 extends Applet {

  int shape;

  public void init() {
    shape=0;
  }

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


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



    /**
     * 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("Line4");
     	Line4 line = new Line4();
    	line.init();
    	line.start();
      f.add("Center", line);
     	f.setSize(700,500);
    	f.show();
    }


}



