01: import java.applet.*;
02: import java.awt.*;
03: import JSci.awt.*;
04: import JSci.maths.chaos.*;
05:
06: /**
07: * Plot of the cat map.
08: * @author Mark Hale
09: * @version 1.1
10: */
11: public final class CatPlot extends Applet {
12: private CatMap cm;
13: private ScatterGraph graph;
14: private final int N = 10000;
15:
16: public void init() {
17: cm = new CatMap();
18: float xData[] = new float[N];
19: float yData[] = new float[N];
20: double x[] = { 0.1, 0.1 };
21: for (int i = 0; i < N; i++) {
22: xData[i] = (float) x[0];
23: yData[i] = (float) x[1];
24: x = cm.map(x);
25: }
26: DefaultGraph2DModel model = new DefaultGraph2DModel();
27: model.setXAxis(xData);
28: model.addSeries(yData);
29: graph = new ScatterGraph(model);
30: graph.setNumbering(false);
31: setLayout(new BorderLayout());
32: add(graph, "Center");
33: }
34: }
|