private float[] calcOrbit(int i, int depth, int color) {
		double xf, yf, a, b, aa, bb;
		int iter = 0;

		xf = smart_random_points[color][i][0];
		yf = smart_random_points[color][i][1];

		a = 2 * (xf - 0.5f);
		b = 2 * (yf - 0.5f);
		aa = a;
		bb = b;

		Complex z = new Complex(aa, bb);
		Complex old = new Complex(z.re, z.im);

		z = Newt(z, aa, bb, alg);

		while (iter < depth && distance(old, z) > rootBoundry) {
			old = new Complex(z.re, z.im);

			z = Newt(z, aa, bb, alg);
			if (mandelbrotAddition)
				z = z.add(new Complex(aa / 2, bb / 2));

			img_cache[iter][0] = z.re;
			img_cache[iter][1] = z.im;
			iter++;
		}

		float solutionColor;
		if (iter != depth_red || (doInverse && runtotal > 25)) {
			if (mandelbrotAddition) {
				// get Color based on angle of z
				z = Newt(z, aa, bb, alg);
				double angle = Math.atan(z.im / z.re);
				angle = angle + (Math.PI / 2);
				angle = angle / Math.PI;
				solutionColor = (float) (angle * 254.0);
			} else {
				float curroot = (float) addRoot(z);
				solutionColor = ((curroot * 254) / roots.size());
			}
		} else {
			solutionColor = 0;
		}

		float[] data = new float[2];
		data[0] = iter;
		data[1] = solutionColor;

		return data;
	}