// You may study, use, modify, and distribute this example for any purpose. // This example is provided WITHOUT WARRANTY either expressed or implied. // ALso: this is NOT a sample of good Java OO style, it is just // a FORTRAN IV program written in Java. import java.applet.*; // Don't forget these import statements! import java.awt.*; import java.lang.Math; /** Displays a mathematical curve called an Henrici Spiral */ public class Henrici extends Applet { public void init() { }//init public void paint(Graphics g) { double v1,v2,t1,t2,d,u1,u2; int n=5000; double t, a1, a2, r1, r2; double c1,c2,s1,s2; double x1,x2,y1,y2; d=1; v1=20;u1=.01; t1=.5; v2=150;u2=.05; t2=.17; g.setColor(Color.white); g.fillRect(1,1,399,399); x1=0; y1=0; g.setColor(Color.blue); for(int i=0; i0)g.drawLine((int)x1,(int)y1,(int)x2,(int)y2); x1=x2; y1=y2; } }//paint /**When used as an application the main program creates the window in which the message is painted. */ public static void main(String args[]) { Frame f = new Frame("Henrici Spiral"); Henrici spiral = new Henrici(); spiral.init(); spiral.start(); f.setBackground(Color.lightGray); f.setForeground(Color.blue); f.add("Center", spiral); f.setSize(400, 400); f.setVisible( true); } }