Consider the region outside a circle of diameter $a$ and inside the square of side length $b$ where $b>a$. I would like to represent this region using a coordinate system $(u,v)$ where the circle and square are represented by equations of the form $u=constant$. While I appreciate there is no unique way of doing this, I was wondering if there are any particularly natural choices, perhaps based on the mappings between squares and circles contained in https://arxiv.org/ftp/arxiv/papers/1509/1509.06344.pdf.
It appears, however, that those mappings only approach a circle near the centre of the region and I'm not sure how to generalise to my case. Thanks in advance for any help.
The region between the circle and the square can be expressed by an angle and a distance from the circle point at that angle to the square point at that angle.
In this image, you can see the resulting shape of the above approach. The $\color{red}{\text{$u$ coordinate is expressed in red}}$, and the $\color{green}{\text{$v$ coordinate is expressed in green}}$. The $u$ coordinate begins at $u=0$, forming a circle, and ends at $u=1$, forming a square.
To achieve the above result starting from cartesian coordinates, first convert the cartesian coordinates to polar coordinates so that you have an angle measurement spanning around the shape and a radius measurement spanning the thickness of the shape. Second, scale the thickness measurement to match the difference in distance between the center of the shapes and their edges at any given angle.
To convert the $(x,y)$ cartesian coordinates to $(r,\theta)$ polar coordinates: $$r=f_1(x,y)=\sqrt{|x^2+y^2|}$$ $$\theta=f_2(x,y)= \begin{cases} \frac{\pi}{2}-\arctan(\frac{x}{y}), & \text{if $y>=0$} \\ \frac{3\pi}{2}-\arctan(\frac{x}{y}), & \text{if $y>0$} \end{cases}$$
To convert the $(r,\theta)$ polar coordinates to $(u,v)$ region coordinates in the space between the circle of diameter $a$ and square of side length $b$: $$u=f_3(r,\theta)= \begin{cases} (r-\frac{a}{2})(b\sqrt{|1+(\tan\theta)^2|}-\frac{a}{2}), & \text{if $|\cos\theta|>=|\sin\theta|$ or more simply $|x|>=|y|$ if $x$ and $y$ are handy} \\ (r-\frac{a}{2})(b\sqrt{|1+(\frac{1}{\tan\theta})^2|}-\frac{a}{2}), & \text{if $|\cos\theta|<|\sin\theta|$ or more simply $|x|<|y|$ if $x$ and $y$ are handy} \end{cases}$$ $$v=f_4(\theta)=\frac{\theta}{2\pi}$$
The conversion above can be simplified by substituting $c$ for the $\theta$ expressions: $$c=g_3(\theta)= \begin{cases} \tan\theta, & \text{if $|\cos\theta|>=|\sin\theta|$ or more simply $|x|>=|y|$ if $x$ and $y$ are handy} \\ \frac{1}{\tan\theta}, & \text{if $|\cos\theta|<|\sin\theta|$ or more simply $|x|<|y|$ if $x$ and $y$ are handy} \end{cases}$$ $$u=g_4(r,c)=(r-\frac{a}{2})(b\sqrt{|1+c^2|}-\frac{a}{2})$$ $$v=g_5(\theta)=\frac{\theta}{2\pi}$$
You can see the equation in action with this shader here: