It doesn't take a method. Just a little arithmetic.
If you used the variables in my strategy, then the variables row and col store the row and column indices of element A. You should be able to write an expression to calculate the row and column indices of element B (ie. centerX and centerY) by adding a value to row and col. That expression should use the pixelating size received as a parameter to the method.
Look at my 3 diagrams with pixelating size 2, 5, 7 and see how much you need to add in each case.