/* Trochor Fun with trochoids. This version © Fergus Crawshay Murray, February 2000. Any comments or suggestions to fcm@oolong.co.uk. */ import java.awt.*; import java.applet.Applet; public class Trochor extends java.applet.Applet implements Runnable { double t, a, b, tF, aF, bF, s=150, r=1,x,y, spin=0, roll=0, rota=100, spinF, rollF, phas; float hue, leng, ratio=3, damp, damping, size; int count, idx, i, length; int drawer=1, c, ox, oy, xcentre=200,ycentre=200; double f; double sineArray[]=new double[1025]; Color colours[]=new Color[256]; boolean clearnow=false; public int axOne=100,axTwo=64, axbOne, axbTwo, ecOne, ecTwo; public Scrollbar dampBar, axOneBar, axTwoBar, ecOneBar, ecTwoBar, ratioBar, rotaBar, phasBar, lengthBar; public TextField inputBox; public CheckboxGroup drawType, symmGroup; public Checkbox wipeBox; public Label ratioLabel, lengthLabel; String theBox,symmName; Image offscreenImg; Graphics offscreenGraphics, g, graphDest; public void init() { // Create lookup tables for colour and trig functions offscreenImg=createImage(this.size().width,this.size().height); offscreenGraphics=offscreenImg.getGraphics(); g=getGraphics(); for (i=0; i