Here is the pseudo-code of how I set the array representing the MandelBrot set, but it gets terribly stretched if you leave the aspect ratio 1: 1.
xStep = (maxX - minX) / width; yStep = (maxY - minY) / height;
Yeah! This is because you must maintain the same aspect ratio for both the image you are drawing and the area of ββthe complex plane you want to draw. In other words, it should contain
width maxX - minX ---------- = --------------------- height maxY - minY
(It follows that xStep == yStep.) Your code probably does not apply this requirement.
source share