public class MandelbrotImage { private final Complex topLeft;//, bottomRight; private final double incA, incB; private final int store[][]; public MandelbrotImage(Complex topLeft, Complex bottomRight, int width, int height) { this.topLeft = topLeft; //this.bottomRight = bottomRight; this.store = new int[height][width]; Complex diff = bottomRight.sub(topLeft); this.incA = diff.getA() / width; this.incB = diff.getB() / height; } public void setLevel(int row, int col, int level) { store[row][col] = level; } public int getLevel(int row, int col) { return store[row][col]; } public Complex getPoint(int row, int col) { return topLeft.add(new Complex(incA*col, incB*row)); } public int getWidth() { return store[0].length; } public int getHeight() { return store.length; } }