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

public class Line5 extends Applet {

  int shape;

  public void init() {
    shape=0;
  }

   double f(double x) {
    	return ( Math.sin(x/7)*Math.exp(-x*0.02) + 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("Line5");
     	Line5 line = new Line5();
    	line.init();
    	line.start();
      f.add("Center", line);
     	f.setSize(700,500);
    	f.show();
    }


}



