/* Copyright F. P. Marin ( August 11 20:38:23 1997 ) E-mail: felix@bloch.ciens.ucv.ve Permission to use, copy, modify and distribute this software and its documentation for NON-COMERCIAL purposes and without fee is hereby granted provided that this copyright notice appears in all copies. F. P. Marin makes no representations or warranties about the suitability of the software, either express or implied, including but no limited to the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. F. P. Marin shall not be liable for any damage suffered by license as a result of using, modifying or distributing this software or its derivatives. HTML code is */ import java.applet.Applet; import java.awt.*; public class ArnoldCat extends Applet { final static double TWOPI=2.0*Math.PI; final int NPOINTS=3000; final String GENSTR="Generation "; double ax,bx,ay,by,x[]=new double[NPOINTS],y[]=new double[NPOINTS]; Font f=new Font("Helvetica",Font.BOLD + Font.ITALIC,20); FontMetrics fm=getFontMetrics(f); Graphics gr; Image img; int genstrwidth=fm.stringWidth(GENSTR),gen=0,ygen; public void init() { ax=0.4*size().width; bx=0.5*size().width + 0.5; ay=-0.4*size().height; by=0.5*size().height + 0.5; ygen=size().height - 5; img=createImage(size().width,size().height); gr=img.getGraphics(); gr.setFont(f); pattern0(); setFont(new Font("TimesRoman",Font.BOLD,18)); setBackground(Color.red.brighter()); setForeground(Color.yellow.brighter()); add(new Button("Original Generation")); } public void update(Graphics g) { paint(g); } public void paint(Graphics g) { gr.setColor(Color.black); gr.fillRect(0,0,size().width,size().height); double temp,theta; int xcat,ycat; for ( int i=0 ; i0.75 ) ); do y[i]=Math.random(); while ( ( 0.25