/** * JuliaSet is an implementation of ChaoticFunction. * * @author Ben Garrison bdg@cc.gatech.edu * @version 1.0 */ public class JuliaSet extends Fractal { private double cx; private double cy; public JuliaSet(double cx, double cy) { super(1000); this.cx = cx; this.cy = cy; } public JuliaSet() { this(-.391, -.587); } /** * @see ChaoticFunction#getColor(double, double) */ public int getColor(double x, double y) { double newx; double newy; //System.out.println("x: " + x + "\ty: " + y); for(int i=0;i 4) { return i; } newx = (x*x-y*y)+cx; newy = (2*x*y+cy); x = newx; y = newy; } return 0; } }