The Conformal Mapping of A Circle Onto A Regular Polygon: Herbert E. M Uller, 2013
The Conformal Mapping of A Circle Onto A Regular Polygon: Herbert E. M Uller, 2013
The Conformal Mapping of A Circle Onto A Regular Polygon: Herbert E. M Uller, 2013
polygon
Abstract
1 Introduction
Analytic functions map the plane of complex numbers onto itself. Such mappings are
conformal, or angle-preserving. Analytic functions are useful e.g. in two-dimensional po-
tential problems in electrostatics and fluid dynamics. A special class of analytic functions
are the Schwarz-Christoffel (SC) transformations. Such a transformation maps a circular
disc or half-plane into a polygonal region. In section 2 we calculate the SC transformation
mapping the unit disc into a regular polygon with K corners (K ≥ 2). In section 3 we
calculate the inverse transformation. In section 4 we use the latter formula to distort a
circular image into a regular polygonal image.
The points wk lie on the circle ∂D. Their images are the polygon corners zk = S(wk ).
The exterior angle of two polygon sides joining in zk is αk .
1
Figure 1: Action of the Schwarz-Christoffel transformation. Here D is the upper halfplane
of C.
The form-invariance is easily shown by direct calculation. (But don’t jump to conclusions:
while Möbius transformations form a group, SC transformations don’t.)
In my textbook [1] D is the upper half plane =(w) ≥ 0 (see fig. 1). Möbius transfor-
mations map circles onto circles, so clearly a SC transformation can map any disc or
half-plane onto any polygonal region. Given a disc D in the w-plane and a polygonal
region E in the z-plane, the first problem is to find the locations of the wk on ∂D such
that they can be mapped onto zk by a SC transformation, and the second problem is to
perform the integration in (2.1a).
From now on, let D be the unit disc centered at 0 in the w-plane. Since wk = 0 is
excluded, we can write the general SC transformation (1) slightly differently:
Z −αk /π
w
z = S(w) = A + B dwΠK
1−
1 (2.3a)
0 wk
XK
wk = exp(iφk ) 0 ≤ αk < π αk = 2π (2.3b)
k=1
2
The new SC transformation S̃ = S ◦ M still maps D on E, but has different values of
A, B, φk (the αk are unchanged).
The Möbius transformation (2.4) has three real parameters: θ, b0 , b00 . We can choose them
such that A = 0 and =(B) = 0, i.e. B = R, a positive real number. The general SC
transformation is then
Z −αk /π
K w
z = S(w) = R dwΠ1 1 − (2.5a)
0 wk
XK
wk = exp(iφk ) 0 ≤ αk < π αk = 2π (2.5b)
k=1
For w 1, z ' Rw, ie. w = 0 is mapped onto z = 0, which must be an inside point
of E, and the surrounding of w = 0 is dilated or contracted, but not rotated. Now the
2K parameters R, α1 . . . αK−1 , φ1 . . . φK are uniquely determined by the 2K coordinates
of the polygon corners z1 . . . zK .
From now on let E be a regular polygonal region centered at 0. The exterior angles of
the regular K-gon ∂E are
αk = 2π/K (2.6)
and the polygon corners are at azimuths
φk = β + 2πk/K (2.7)
with 0 ≤ k ≤ K − 1. We can choose the angle β of the “zeroth” corner freely. From
symmetry we expect that the mapping of D onto E can be achieved with the points
wk = S −1 (zk ) at the same azimuths as the polygon corners zk , ie.
Inserting the wk of (2.8) into (2.5a) and evaluating the product we obtain a surprisingly
simple formula: Z
−2/K
z = R dw 1 − wK exp(−iKβ)
(2.9)
0
Eqn. (2.10b) contains the incomplete beta function B(z; p, q), see [1]:
R K 1 2
z= exp(iβ)B (w exp(−iβ)) ; , 1 − (2.11)
K K K
with Z z
B(z; p, q) = dttp−1 (1 − t)q−1 (2.12)
0
3
One must be careful with eqn. (2.11) because the integration variable t in eqn. (2.10b)
passes through more than one Riemann leaf unless β − π/K < arg(w) ≤ β + π/K.
For the limiting case K = 2 of the “Digon”, eqn. (2.11) becomes
Setting w = wk = exp i(β + 2πk/K) in eqn. (2.11), we obtain the polygon corners
−1
R 1 2 −1/K
zk = B ,1 − exp i(β + 2πk/K) = R exp i(β + 2πk/K) (2.15)
K K K 1/K
B(p, q) in the middle is the (complete) beta function, the large parenthesis on the right
is the binomial coefficient ”−1/K choose 1/K”.
In fig. 2, a set of concentric circles in the unit disc is transformed onto the regular
polygons K = 2 − 6 using the series (2.14).
Figure 2: Mapping of the unit disc onto a regular polygon with Schwarz-Christoffel. The
original concentric circles are at the radii 5/15, 9/15, 12/15, 14/15, 15/15.
3 Inversion
In this section we set set for simplicity R = 1.
Let’s first settle the limiting case K = 2 of the “Digon”: the inverse transformation
is
w = exp(iβ)tanh(z exp(−2βi)) (3.1)
Now we attack the more difficult cases K ≥ 3. SC transformations do not form a group,
so the inverse transformation is in general not a SC transformation. Eqn. (2.14) with
R = 1 has the form
4
We want the inverse series of the form w = zg(z K ) = z(1 + b1 z K + b2 z 2K + . . .). The
inversion formula is (see [1] p. 367)
∞
X z mK
w=z D0mK [f (wK )]−mK−1 (3.3)
m=0
(mK + 1)!
Here D0l means “derive l times and then set w = 0”. For a “normal” Taylor series
we would set K = 1. But the case K = 2 occurs actually quite often, e.g. in the
trigonometric functions sin(z) and tan(z), and the case K ≥ 3 occurs in our formula
(2.14), so an inversion formula with general K is useful. Evaluating eqn.s (3.2), (3.3)
gives
It is convenient to transfer the factor exp(−iKβ) to z K , ie. we write eqn.s (3.4), (3.5)
as
w = z[1 − a1 (z exp(−iβ))K + (−a2 + (K + 1)a21 )(z exp(−iβ))2K . . .
+ (−a3 + (3K + 2)(a1 a2 − 21 (K + 1)a31 ))(z exp(−iβ))3K . . .
(3.6)
+ (−a4 + (2K + 1)(2a1 a3 + a22 − (4K + 3)(a21 a2 − 31 (K + 1)a41 )))(z exp(−iβ))4K
−1
× 1 + (z exp(−iβ)/zmax )K ]
with
n − 1 + 2/K 1
an = (3.7)
n 1 + nK
and
zmax = K −1 B(1/K, 1 − 2/K) (3.8)
The last factor in eqn. (3.6) needs an explanation. If you calculate the Taylor coefficients
b0 = 1, b1 = −a1 , b2 = (−a2 + (K + 1)a21 ), b3 = . . ., b4 = . . . in eqn. (3.6) for some K, you
−K
will find that the ratio bn+1 /bn approaches the value −zmax , ie. the series (2.14) becomes
more and more geometric. The factor in question incorporates this observation.
Numerical tests have shown that the precision of (3.6) is very good: the error is one or
two tenths of a percent at worst for all z within the polygon (in fact in the whole disc of
convergence with radius zmax ) and for all K ≥ 3.
5
section, the idea is, to select a circular region in the image, and to distort it into a regular
polygonal region. I chose M. C. Escher’s drawing “circle limit IV” to demonstrate the
effect of the transformation. Escher’s drawing is already contained in a circle, and since
it has three-fold symmetry, the mappings into equilateral triangles and regular hexagons
give the nicest effect.
Figure 3: The drawing “circle-limit IV” by M. C. Escher distorted into regular triangles
and hexagons by means of the inverse Schwarz-Christoffel transformation (3.6). In the
triangle corners, the pixels of the original image can be seen.
6
A An alternative transformation formula
The series (2.14) converges badly if w is close to one of the wk . This can be seen in fig. 2:
the transformed unit circle was calculated summing approximately 1000 terms, and yet
the polygon corners are still slightly rounded off. To avoid this problem, we can set
Z w
−2/K
dw0 1 − w0K exp(−iKβ)
z = zk + R (A.1)
wk
The arguments of the series (2.14) and (A.3) are t = wK exp(−iKβ) and 1 − t. The discs
of convergence and recommended domains of application of both series are shown in fig.
4.
Figure 4: Discs of convergence of the series (2.14) (left) and (A.3) (right) in t =
wK exp(−iKβ), recommended domains where each series should be used.
7
disp(’Distort a circular image excerpt into a polygonal shape.’);
disp([’The image must be square, the sides must have odd pixel size.’]);
% read original
s=input(’Type "imagename.ext": ’,’s’);
I=imread(s); % original
siz=size(I);
disp([’Image size = ’ int2str(siz)]);
8
fI=uint8(zeros(sizZ,sizZ,3)); % color image
else
fI=uint8(zeros(sizZ,sizZ)); %gray image
end
% mapping
fI(inZ)=I(inW); % gray or red
if co
fI(inZ+sizZ^2)=I(inW+sizW^2); % green
fI(inZ+2*sizZ^2)=I(inW+2*sizW^2); %blue
end
figure(2);clf;
imshow(fI);hold on;
plot(real(Zk),imag(Zk),’r’,’linewidth’,1);hold off;
% save image
h=input(’Do you want to save the distorted picture as a png? (y/n) ’,’s’);
if strcmp(h,’y’)
imwrite( fI,[s(1:length(s)-4) ’K’ num2str(K) ’.png’] );
disp([’Distorted picture saved as "’ s(1:length(s)-4) ’K’ ...
num2str(K) ’.png".’]);
end
9
References
[1] Arfken, G., Mathematical Methods for Physicists, 1970, Academic Press, New York,
2nd ed.
[2] GNU Octave, J. W. Eaton, D. Bateman & S. Hauberg, http://www.octave.org.
10