1 package JSci.maths.chaos; 2 3 import JSci.maths.*; 4 5 13 public final class CatMap extends Object implements MappingND { 14 17 public CatMap() {} 18 23 public double[] map(double x[]) { 24 double ans[]=new double[2]; 25 ans[0]=(x[0]+x[1])%1; 26 ans[1]=(x[0]+2*x[1])%1; 27 return ans; 28 } 29 35 public double[] iterate(int n,double x[]) { 36 double xn[]=map(x); 37 for(int i=1;i<n;i++) 38 xn=map(xn); 39 return xn; 40 } 41 } 42 43 | Popular Tags |