1 import java.applet.*; 2 import java.awt.*; 3 import JSci.awt.*; 4 import JSci.maths.chaos.*; 5 6 11 public final class HenonPlot extends Applet { 12 private HenonMap cm; 13 private ScatterGraph graph; 14 private final int N=10000; 15 public void init() { 16 cm=new HenonMap(cm.A_CHAOS,cm.B_CHAOS); 17 float xData[]=new float[N]; 18 float yData[]=new float[N]; 19 double x[]={0.0,0.0}; 20 for(int i=0;i<N;i++) { 21 xData[i]=(float)x[0]; 22 yData[i]=(float)x[1]; 23 x=cm.map(x); 24 } 25 DefaultGraph2DModel model=new DefaultGraph2DModel(); 26 model.setXAxis(xData); 27 model.addSeries(yData); 28 graph=new ScatterGraph(model); 29 graph.setNumbering(false); 30 setLayout(new BorderLayout()); 31 add(graph,"Center"); 32 } 33 } 34 35 | Popular Tags |