What's a good algorithm to numerically generate a conformal mapping from a polygon to a distorted version thereof?

102 Views Asked by At

I am curious about this. I was trying to write a piece of computer code for improving an existing graphics package which I need not name but one of the things it needs to do is create a conformal map between the interior of a drawn polygon and the interior of the same polygon with its vertices shifted to different points.

That is, given two plane polygons with the same number of vertices i.e. $V_1, V_2, \cdots, V_n$ and $V'_1, V_2, \cdots, V'_n$, both given in the order from 1 to $n$ (and we can assume the polygons to be not self-crossing), determine the conformal mapping that exists between them per the Riemann mapping theorem, and which sends $V_j$ to $V'_j$ for all $j \in \{ 1, 2, \cdots, n\}$.

My attempt

The first idea I had so far was to try and consider the following approach: let the filled source polygon be denoted $P_S$, and the filled destination polygon $P_D$. Then we decompose the map

$$\phi_{S \rightarrow D}: P_S \rightarrow P_D$$

into

$$\phi = \phi_{U \rightarrow D} \circ \phi_{S \rightarrow U}$$

where $P_U$ is the filled unit disk (just using "P" for notational consistency). The first (i.e. the one on the right, actually the second applied) mapping is actually not so hard to construct: it seems one can do this by simply using the complex Cauchy's integral formula, which effectively solves Laplace's equation within the disk, though perhaps this is not a too-efficient method, where we have a parameterization function that traces the boundary $\partial P_S$ of $P_S$ in the order of the vertices.

However, it's the second mapping that's the rub. Apparently, this is called a Schwarz-Christoffel mapping, and it seems nontrivial to compute - and what I'm wondering is whether there is a more efficient algorithm for this special case. Is there? I apparently found an algorithm called "CRDT"

https://ecommons.cornell.edu/bitstream/handle/1813/5567/96-233.pdf?sequence=1&isAllowed=y

but I did not really understand how it all works from there, and moreover it seems a bit too general for this case. Does the specificity of this problem admit something simpler or is that as good as it gets?

(Moreover, apparently while that algorithm was published over 24 years[!] ago, what is mentioned in the paper regarding uncertainty as to its guaranteed correctness is unresolved; though if it's been used this long without someone finding something surprising then chances are you can "trust" it.)