I'm trying to create a formula from unit circle to square centered at origin with side length 2. The formula I have is, by pieces: From -pie/4 to pie/4, (1, y/x) From pie/4 to 3pie/4, (x/y, 1) From 3pie/4 to 5 pie/4, (-1, y/x) From 5pie/4 to 7 pie/4, (x/y, -1) Never mind the trivial issue of 7pie/4 and -1pie/4. My problem is, I don't want the separation of circle into 4 pieces in terms of pie. I need them in terms of x and y. So far I have For "-pie/4 to pie/4, x => Abs[y] For " pie/4 to 3pie/4, y => Abs[x] But what are they for "from 3pie/4 to 5pie/4" and "5pie/4 to 7pie/4" ??? This looks easy, but I have been twisiting my head for more than a few hours. Please help.