andelbrot(x, y) {
            let z = 0;
            let n = 0;
            while (Math.abs(z) <= 2 && n < maxIterations) {
                z = z * z + new Complex(x, y);
                n++;
            }
            return n;
        }


        class Complex {
            constructor(real, imag) {
                this.real = real;
                this.imag = imag;
            }

            // Needed for comparing absolute value above.
            abs() {
                return Math.sqrt(this.real * this