head 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 97.11.09.01.23.12; author kowallik; state Exp; branches; next ; desc @@ 1.1 log @Initial revision @ text @// the number crunching class - separate thread that calculates // position and velocity of pendulum and returns it import java.util.*; import java.lang.*; class animation extends Thread { // variables used in the static rk4 routine have to be static static double y[]=new double[2]; static double damp, ext, phi, w, x; // I need this to reset x0, v0 to initial values double oldy[]=new double[2]; double duration, xstart=0; int delay; Control_Win control; graphic out; P_Graph phase; T_Graph time; animation(Control_Win incontrol, double inxstart, double iny[], double inphi, double indamp, double inw, double inext, double induration, int indelay) { control = incontrol; y=iny; oldy=iny; damp=indamp; delay=indelay; duration=induration; phi=inphi; ext=inext; w=inw; out=control.out; phase=control.phase; time=control.time; } public void cleanup() { xstart=0; y=oldy; } public void run() { int f_data=0; double k; for(x=xstart; x