I am quite confused as to the desired output. Your code produces:
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
oooooooooooooooooooo
I don't understand what that means? There is a Math::Trig module that can deal with rectangular and spherical coordinates or 2 dimensional versions (x,y and polar,magnitude and angle). Sorry that I'm being dense, but I don't understand the requirement yet.
Update: Just as a wild thought, maybe this is a graphical representation of a target grid? You are going to drop a bomb at a particular coordinate in this grid with a blast radius of X. All of the affected "o's" should turn into "x's". Is that analogy right?