<p>The mapping is not unique.  There are many other solutions to this question.</p>
<p>For example, this mapping will also work</p>
<blockquote>
<p>u = x √(x² + y² - x²y²) / √(x² + y²)</p>
<p>v = y √(x² + y² - x²y²) / √(x² + y²)</p>
</blockquote>
<p>where <strong>(u,v)</strong> are circular disc coordinates and <strong>(x,y)</strong> are square coordinates.</p>
<p>A picture is worth a thousand words, so here are some images to illustrate the non-uniqueness of the mapping and its inverse.</p>
<p><a href="https://i.stack.imgur.com/n0ILh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/n0ILh.png" alt="circular Brady bunch" /></a></p>
<hr />
<p><a href="https://i.stack.imgur.com/7f3r1.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/7f3r1.jpg" alt="squared Boston Celtics" /></a></p>
<p><code>For a C++ implementation</code> of this other mapping, go to<br />
<a href="http://squircular.blogspot.com/2015/09/fg-squircle-mapping.html" rel="noreferrer">http://squircular.blogspot.com/2015/09/fg-squircle-mapping.html</a><br />
See <a href="http://squircular.blogspot.com" rel="noreferrer">http://squircular.blogspot.com</a> for more images of mapping results.</p>
<p>See also <a href="http://arxiv.org/abs/1509.06344" rel="noreferrer">&quot;Analytical Methods for Squaring the Disc&quot;</a> for a paper discussing different mapping equations with proofs and derivations.</p>
How can I convert coordinates on a square to coordinates on a circle?
<p>I'm developing an indie video game, and have been operating under the assumption that because the thumbstick on my controller has a circular range of motion, it returns "circular" coordinates; that is, Cartesian coordinates constrained to a circular area (of radius 1). In fact, the coordinates are "square"; e.g., the top-right thumbstick position registers as x=1,y=1. When I convert the coordinates from Cartesian to polar, the magnitude can exceed 1 - which has the effect that the player can move faster diagonally than they can vertically or horizontally.</p>

<p>So, to clarify, I want to record the position of an analog thumbstick in terms of a direction and magnitude, where the magnitude is between 0 and 1. The thumbstick returns coordinates on a square plane, so simply converting the coordinates from Cartesian to polar is not sufficient. I think I need to convert the coordinate <em>space</em>, but that is pressing the limits of my monkey brain.</p>