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