public double[] getLocalGrid(long density) {
        int numberOfDots = (int) (density * getWidth());
        double gridStep = 1 / (double) density;
        double[] grid = new double[numberOfDots];
        for (int i = 0; i < numberOfDots; i++) {
            grid[i] = ((double) i + 0.5) * gridStep;
        }
        return grid;
    }