Your generation seems correct (i.e. don't do x1 = x2 +300; y1 = y2 +300;
), but your problem is you're way off the scale for the purposes of rendering. This means there are very few points that fall outside very center of the image.
Your window is [0..600]x[0..600]
. Try multiplying x2
and y2
with 50, so that you're rendering the [-6..6]x[-6..6]
region instead of the [-300..300]x[-300..300]
region of space.
Note that it should be sufficient to draw single pixels (as lines to itself) instead of 3x3 ovals.
int xp = 300 + (int) (x2 * scale);
int yp = 300 + (int) (y2 * scale);
g.drawLine(xp, yp, xp, yp);
Depending on what gets rendered, you might need to adjust the scale slightly to get the entire image with reasonable bounds. Note the second transformation offsets by -6.7
, so a scale of 30 should be about right.
Also note that by using x1 = x2 +300; y1 = y2 +300;
you change the transformations and get a different fractal (at a scale at which you expect).