import java.awt.Graphics;
public class Figure extends java.applet.Applet {
     double f(double x) {
	       return (Math.cos(x/10)+1) * getSize().height / 2;
    }
    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));
        }
   }
}