Getting point on a rectangle border
Most rectangles have a length and a width.  I’ve never heard of a rectangle with a radius, but it would be known as a square.

More constructively:

System.out.print(String.format("(%d,%d) ", x - r + i, y - r));


Could be written as:

System.out.format("(%d,%d) ", x - r + i, y - r);