<blockquote>
  <p>x = ½ √( 2 + u² - v² + 2u√2 ) - ½ √( 2 + u² - v² - 2u√2 )<br>
  y = ½ √( 2 - u² + v² + 2v√2 ) - ½ √( 2 - u² + v² - 2v√2 )</p>
</blockquote>

<p>Note on notation: I'm using x = xSquare , y = ySquare, u = xCircle and v = yCircle;</p>

<p>i.e. <strong>(u,v)</strong> are circular disc coordinates and <strong>(x,y)</strong> are square coordinates.</p>

<p><a href="https://i.stack.imgur.com/VSFoo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VSFoo.png" alt="grid mapping"></a></p>

<p>For a C++ implementation of the equations, go to<br>
<a href="http://squircular.blogspot.com/2015/09/mapping-circle-to-square.html" rel="noreferrer">http://squircular.blogspot.com/2015/09/mapping-circle-to-square.html</a> </p>

<p>See <a href="http://squircular.blogspot.com" rel="noreferrer">http://squircular.blogspot.com</a>
for more example images.<br>
Also, see <a href="http://arxiv.org/abs/1509.06344" rel="noreferrer">http://arxiv.org/abs/1509.06344</a> for the proof/derivation</p>

<p>This mapping is the inverse of  </p>

<blockquote>
  <p>u = x √( 1 - ½ y² )<br>
  v = y √( 1 - ½ x² )</p>
</blockquote>

<hr>

<p>P.S. The mapping is not unique.  There are other mappings out there. The picture below illustrates the non-uniqueness of the mapping.</p>

<p><a href="https://i.stack.imgur.com/rDL3l.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/rDL3l.jpg" alt="Boston Celtics squared"></a></p>
How can I convert coordinates on a circle to coordinates on a square?
<p>I'm currently working on a game in LBP2 that has modify the way a controller gives input.  This question:
<a href="https://stackoverflow.com/questions/1621831/how-can-i-convert-coordinates-on-a-square-to-coordinates-on-a-circle">How can I convert coordinates on a square to coordinates on a circle?</a>
Has helped me quite a lot with what I am doing, but I do have one problem.  I need the inverse function of the one they give.  They go from square -> circle, and I've tried searching all over for how to map a circle to a square.</p>

<p>The function given in the previous question is:</p>

<blockquote>
  <p>xCircle = xSquare * sqrt(1 - 0.5*ySquare^2)</p>
  
  <p>yCircle = ySquare * sqrt(1 - 0.5*xSquare^2)</p>
  
  <p>From <a href="http://mathproofs.blogspot.com/2005/07/mapping-square-to-circle.html" rel="nofollow noreferrer">Mapping a Square to a Circle</a></p>
</blockquote>

<p>My question is given xCircle and yCircle... how do I find xSquare and ySquare?</p>

<p>I've tried all of the algebra I know, filled up two pages of notes, tried to get wolfram alpha to get the inverse functions, but this problem is beyond my abilities.</p>

<p>Thank you for taking a look.</p>