A Processing sketch to generate and draw the Mandelbrot and Julia sets

I have used my limited knowledge of processing and made a sketch to generate the Mandelbrot set and various Julia sets. I've tried to make it efficient as possible. It's also interactive, and keyPressed() should explain that sufficiently.

Here is the code:

int mi = 255;
float r = 0.5, a = 0;
float[] bbox = new float[]{-0.5, 0, 2};
float[] c = new float[]{-0.8, 0.15};
boolean rot = false, mode = true;

void setup() {
size(720, 720);
display();
}

void draw() {
if (rot) {c = r*cos(a*PI); c = r*sin(a*PI); a += 0.01; r += 0.001; display();}
}

void display() {
float q, za, zb, zas, zbs, ta;
int i = 0, x, y;
for (x = 0; x < width; x++) {
for (y = 0; y < width; y++) {
za = map(x, 0, width, bbox-bbox, bbox+bbox);
zb = map(y, 0, width, bbox-bbox, bbox+bbox);
q = pow((za-0.25),2)+zb*zb;
if (mode) {c = za; c = zb;}
if (!mode || q*(q+(za-1/4)) >= zb*zb/4) {
zas = za*za; zbs = zb*zb;
for (i = 0; i < mi; i++) {
ta = zas-zbs+c;
zb = 2*za*zb+c;
za = ta;
zas = za*za; zbs = zb*zb;
if (zas+zbs > 4) {
break;
}
}
}
pixels[x+y*width] = color(map(sqrt(i%mi), 0, sqrt(mi), 0, 255));
}
}
updatePixels();
}

void keyPressed() {
//Zoom window
if (key == 'e') {bbox /= 2; display();} //Zoom in
if (key == 'q') {bbox *= 2; display();} //Zoom out

//Pan window
if (key == 'w') {bbox -= bbox/5; display();} //Pan up
if (key == 'a') {bbox -= bbox/5; display();} //Pan left
if (key == 's') {bbox += bbox/5; display();} //Pan down
if (key == 'd') {bbox += bbox/5; display();} //Pan right

//Resetting
if (key == 'c') {c = new float[]{-0.8, 0.15}; display();} //Reset c value
if (key == 'x') {if (mode) {bbox = new float[]{-0.5, 0, 2};} else {bbox = new float[]{0, 0, 2};}; display();} //Reset view

//Changing mode
if (key == 'z') {mode = !mode; if (mode) {bbox = new float[]{-0.5, 0, 2};} else {bbox = new float[]{0, 0, 2};}; display();} //Toggle mandelbrot/julia set mode

//Animations
if (key == 'r' && !mode) {rot = !rot; display();} //Toggle julia set rotating animation

//Offset c value in f(z) = z^2 + c
if (key == 't') {c -= 0.01; display();} //Offset up
if (key == 'f') {c -= 0.01; display();} //Offset left
if (key == 'g') {c += 0.01; display();} //Offset down
if (key == 'h') {c += 0.01; display();} //Offset right

// Change iteration number
if (key == 'v') {mi = constrain(mi-8, 7, 1023); display();} //Decrease iteration number
if (key == 'b') {mi = constrain(mi+8, 7, 1023); display();} //Increase iteration number
}

The reason that there is so much redundancy of display(); is that if I put it in the draw loop, it has a tendency to miss key presses. Also, i apologize for the cryptic variable names, however, most should be self explanatory.