import java.awt.Graphics; public class FloydApplet extends java.applet.Applet { double f(double x) { // return (Math.cos(x/5) + Math.sin(x/7) + 2) * size().height / 4; return (Math.cos(x/3)*Math.cos(x/30) + 1)/2 * size().height; } public void paint(Graphics g) { for (int x = 0 ; x < size().width ; x++) { g.drawLine(x, (int)f(x), x + 1, (int)f(x + 1)); } } public String getAppletInfo() { return "draws a sin graph."; } }