∮

Conformal Maps: When Complex Functions Preserve Angles

A conformal map preserves angles: near every point it behaves like a rotation followed by a uniform scaling. Explore them in a playground that warps grids and images — written with complex numbers, 2D vectors, and dual numbers.

·15 min read

Take a sheet of rubber, draw a fine square grid on it, and stretch it. Most deformations destroy the grid: squares become parallelograms, circles become ellipses, right angles open up or close. A conformal map is the special kind of deformation that never does that — at every point, and in every direction, it stretches by the same amount and rotates by the same angle. Locally it is a rotation and a zoom, nothing else.

That single constraint is surprisingly powerful. Conformal maps are the reason a Mercator projection keeps small shapes recognizable, the reason a Joukowski transform turns circles into airfoils, and the reason two-dimensional electrostatics and ideal fluid flow can be solved by drawing pictures. They are also the natural home of complex analysis: away from critical points, every holomorphic function is conformal.

The Playground

Below is a map from the plane to itself. The left panel is the domain (the zz-plane); the right panel is the image (the ww-plane, with w=f(z)w = f(z)). Type any formula, drag to pan, scroll to zoom, and hover the domain to inspect the local behaviour at a point.

Conformal Map Playground

f(z) =

z is complex · also x, y, i, pi · exp log sqrt sin cos tan conj abs arg re im

domainz plane
imagew = f(z)
drag to pan · scroll to zoom
test imagesdrop an image anywhere on this panel · images are mapped from the square [-1, 1]²
hover the domain to inspect z, w and the local derivative — the white circle shows how a small circle is deformed

A few things to try:

  • Type z^2, then hover near the origin and near 1+i1+i. The distortion readout stays at 1.0001.000 everywhere except at the origin, where the derivative vanishes and the map stops being conformal.
  • Pick one of the test images — or drop your own image onto the panel. The image is warped through the same formula, so you can see exactly what the map does to recognizable shapes.
  • Try 1/z, exp(z), log(z), sqrt(z), and (z - 1)/(z + 1) and watch where the grid tears, folds, or wraps around.
  • Hover the domain: the white circle is a tiny circle around zz, and its image is drawn on the right. The indigo and emerald arrows are the images of the xx and yy directions.

The expression language is small but expressive:

NameMeaning
zthe complex point, x+iyx + iy
x, yreal and imaginary parts of z
r, thetapolar coordinates of z
i, pi, tau, econstants
exp, log, sqrt, sin, cos, tanthe usual complex functions
conj, abs, arg, re, imconjugation and projections
vec(u, v)build a 2-vector from two real expressions
pow, dot, cross, polar, cisextras

Powers can be written z^2, z**2, or even z²; √z is accepted as shorthand for sqrt(z).

A Derivative Is a Rotation and a Scale

Let ff be complex differentiable at z0z_0. For a small complex step hh,

f(z0+h)=f(z0)+f′(z0) h+O(h2).f(z_0 + h) = f(z_0) + f'(z_0)\,h + O(h^2).

The constant term moves the point; the whole local story is in the linear term h↦f′(z0)hh \mapsto f'(z_0)h. Write the derivative in polar form,

f′(z0)=s eiθ,s=∣f′(z0)∣,θ=arg⁡f′(z0).f'(z_0) = s\,e^{i\theta}, \qquad s = |f'(z_0)|, \quad \theta = \arg f'(z_0).

Multiplying a vector hh by seiθs e^{i\theta} rotates it by θ\theta and scales it by ss. Every direction is rotated by the same θ\theta and scaled by the same ss, so the angle between any two curves through z0z_0 is preserved — provided f′(z0)≠0f'(z_0) \neq 0. At a critical point, where f′(z0)=0f'(z_0) = 0, the map collapses directions together and angles are multiplied by the order of the zero.

This is exactly what the playground reports when you hover:

  • local scale =∣det⁡J∣= \sqrt{|\det J|}, the geometric-mean stretch;
  • rotation =arg⁡f′(z)= \arg f'(z);
  • distortion =σmax⁡/σmin⁡= \sigma_{\max}/\sigma_{\min}, the ratio of the singular values of the Jacobian.

For a conformal map the distortion is 11: the Jacobian is a scalar multiple of a rotation matrix. That is the operational definition the rest of this post leans on.

∑

A holomorphic function is conformal at every point where its derivative is nonzero. Conversely, a smooth map of the plane that is conformal and orientation-preserving is holomorphic. The two notions coincide in two dimensions.

The Cauchy–Riemann View

Write f=u+ivf = u + iv with u,vu, v real functions of (x,y)(x, y). The Jacobian is

J=(uxuyvxvy).J = \begin{pmatrix} u_x & u_y \\ v_x & v_y \end{pmatrix}.

This matrix is a rotation composed with a uniform scale exactly when it has the form

J=(a−bba),J = \begin{pmatrix} a & -b \\ b & a \end{pmatrix},

which is equivalent to the Cauchy–Riemann equations

ux=vy,uy=−vx.u_x = v_y, \qquad u_y = -v_x.

When they hold, f′(z)=ux+ivxf'(z) = u_x + i v_x, the determinant is ux2+vx2=∣f′∣2u_x^2 + v_x^2 = |f'|^2, and both singular values equal ∣f′∣|f'|.

The playground never solves these equations symbolically. It computes the two columns of JJ exactly, using dual numbers, and then measures how far JJ is from being a scaled rotation.

When Angles Are Not Preserved

A complex formula is only one way to write a map of the plane. A general map F(x,y)=(u,v)F(x, y) = (u, v) — a 2D vector field — need not satisfy Cauchy–Riemann, and then angles change. Switch the playground above to ℝ² vector mode and try vec(x, 2*y): horizontal lengths are untouched while vertical lengths double. The distortion readout becomes 2.0002.000, and the hover circle turns into an ellipse.

A non-conformal stretch: F(x,y) = (x, 2y)

F(x,y) =

build a 2-vector with vec(u, v) · x, y, r, theta · dot, cross · same functions as ℂ

domainz plane
imagew = f(z)
drag to pan · scroll to zoom
hover the domain to inspect z, w and the local derivative — the white circle shows how a small circle is deformed

The singular-value decomposition of JJ says the same thing geometrically: every linear map is a rotation, then a stretch along two perpendicular axes, then another rotation. The stretch is uniform — both axes stretched by the same factor — precisely when the map is conformal. The ratio σmax⁡/σmin⁡\sigma_{\max}/\sigma_{\min} measures how far it is from that ideal. A shear like vec(x + 0.5*y, y) has distortion 1.641.64, even though it preserves area.

Writing a conformal map as a vector field gives the same thing as writing it as a complex function. Compare

vec(x2−y2, 2xy)andz2=(x2−y2)+i (2xy).\text{vec}(x^2 - y^2,\ 2xy) \qquad\text{and}\qquad z^2 = (x^2 - y^2) + i\,(2xy).

They are the same map: the vector (u,v)(u, v) is just the complex number u+ivu + iv in disguise. The vector notation emphasizes that the map is a deformation of the plane; the complex notation makes the rotation-and-scale structure obvious.

ℹ

The vector and complex modes share the same evaluator. The only difference is what you write: vec(u, v) spells out the two real components, while z^2 uses complex algebra. The geometry is identical, and the conformality check is the same Jacobian calculation.

Dual Numbers: Derivatives Without Doing Calculus

To draw the derivative arrows and the distortion readout, the playground needs JJ at arbitrary points, for arbitrary user formulas. Finite differences would work, but they lose precision and break down near singularities. Instead the evaluator uses dual numbers.

A dual number has the form a+bεa + b\varepsilon, where

ε2=0.\varepsilon^2 = 0.

That single rule is enough to make Taylor's theorem exact to first order. For any analytic function,

f(a+bε)=f(a)+b f′(a) ε.f(a + b\varepsilon) = f(a) + b\,f'(a)\,\varepsilon.

Feed in ff, read off the coefficient of ε\varepsilon, and you have the derivative — no symbolic differentiation, no step size, no cancellation. This is forward-mode automatic differentiation, applied to complex numbers; the automatic differentiation article builds the same machinery for ordinary reals in C++.

The playground's values carry a complex dual part,

v=(a+bi)+ε (c+di),v = (a + bi) + \varepsilon\,(c + di),

so a single expression can be evaluated with a complex seed. Multiplication follows the product rule:

function mul(a: Num, b: Num): Num {
  return {
    re: a.re * b.re - a.im * b.im,
    im: a.re * b.im + a.im * b.re,
    de: a.de * b.re - a.di * b.im + a.re * b.de - a.im * b.di,
    di: a.de * b.im + a.di * b.re + a.re * b.di + a.im * b.de,
  }
}

The de and di fields are the real and imaginary parts of the ε\varepsilon-channel. Seeding zz with ε=1\varepsilon = 1 gives ∂w/∂x\partial w / \partial x; seeding it with ε=i\varepsilon = i gives ∂w/∂y\partial w / \partial y. Two evaluations, both exact, and the Jacobian falls out:

const w  = f(x, y, 0, 0)     // f(z)
const dx = f(x, y, 1, 0)     // ∂w/∂x stored in the ε-channel
const dy = f(x, y, 0, 1)     // ∂w/∂y stored in the ε-channel

Because the seed can be any complex direction, the same machinery handles non-holomorphic formulas too: what comes out is the directional derivative Df[v]Df[v]. For a holomorphic ff, that equals f′(z) vf'(z)\,v for every vv — the rotation-and-scale property again.

Try It Explicitly

In ε dual mode, eps is the nilpotent unit itself. Writing f(z + eps) makes the derivative appear as the ε\varepsilon-coefficient. Try (z + eps)^3: the main part is z3z^3, and the ε\varepsilon-part is 3z23z^2.

Dual numbers: f(z + ε) = f(z) + ε·f′(z)

f(z+ε) =

eps is the nilpotent unit, eps² = 0 · write f(z + eps) to read off the derivative

step
domainz plane
imagew = f(z)
drag to pan · scroll to zoom
hover the domain to inspect z, w and the local derivative — the white circle shows how a small circle is deformed

Now switch the step between 11, ii, and (1+i)/2(1+i)/\sqrt2 with the small buttons. For a holomorphic map the ε\varepsilon-part rotates with the step, but its length is unchanged: the derivative acts by a fixed rotation and scale. Then try (z + eps) + 0.5*conj(z + eps). The ε\varepsilon-part now changes length when you change the step direction — the map has a preferred direction, and angles are not preserved.

💡

The ε\varepsilon-coefficient is a complex number, so it has a length and a direction. Those are exactly the local scale factor and the local rotation of the map. If you can compute the coefficient, you can draw the geometry.

The Usual Suspects

Some maps are worth knowing by name. Each is a useful experiment in the playground.

MapBehaviourConformal where
z2z^2doubles angles; wraps the plane twice; right half-plane maps onto the plane slit along the negative real axiseverywhere except 00
znz^nmultiplies angles by nn; nn-to-oneeverywhere except 00
1/z1/zinversion; sends circles and lines to circles and lineseverywhere except 00
eze^zperiodic with period 2πi2\pi i; vertical strips become annular sectorseverywhere
log⁡z\log zinverse of eze^z; unwraps the plane into a stripaway from the branch cut
z\sqrt zhalf-angle map; two branchesaway from the branch cut
az+bcz+d\dfrac{az+b}{cz+d}Möbius transformation; generalized circles map to generalized circleseverywhere except the pole
sin⁡z\sin z, tan⁡z\tan ztrigonometric distortions, periodicwhere cos⁡z≠0\cos z \neq 0
z+1/zz + 1/zJoukowski map; the unit circle folds onto the segment [−2,2][-2, 2]everywhere except ±1\pm 1

The Möbius maps are the celebrities. They are the only bijections of the Riemann sphere that are conformal everywhere, and they act on the set of circles and straight lines as a single family — a line is just a circle through infinity. The playground's (z - 1)/(z + 1) sends the imaginary axis to the unit circle and is a good way to see this.

The Joukowski map is the aerodynamics workhorse. Applied to a circle that passes near z=1z = 1 but encloses it, it produces something remarkably close to an airfoil cross-section. The map is conformal except at z=±1z = \pm 1, where the derivative vanishes and a sharp trailing edge appears. That is not a coincidence: the sharp edge of the airfoil is a critical point of the map.

Holes, Folds, and Branch Cuts

Conformality is a local property. A map can be conformal at every point and still be globally wild:

  • z2z^2 folds the plane onto itself; two points map to the same image. It is conformal at both of them (unless one is the origin).
  • eze^z is conformal everywhere but repeats itself every 2πi2\pi i.
  • log⁡z\log z and z\sqrt z cannot be continuous on a loop around the origin; a branch cut has to be chosen, and the map jumps across it.
  • 1/z1/z is conformal except at its pole, where the image runs off to infinity.

The playground draws all of these honestly. Near a pole the mapped grid escapes to very large coordinates; across a branch cut two nearby points land far apart. Those are features of the map, not rendering bugs. Folding also matters for image warping: when ff is not injective, different parts of the image land on top of each other.

For simply connected domains there is a spectacular global theorem. The Riemann mapping theorem states that any simply connected open proper subset of C\mathbb{C} is conformally equivalent to the unit disk. Any such region can be flattened into a disk by a holomorphic bijection. The theorem says nothing about how to find the map, which is why numerical conformal mapping — Schwarz–Christoffel methods, zipper algorithms, circle packing — is a research area of its own.

Images Are Test Cards

A photograph is a great way to see a conformal map. Because the map is locally a rotation and a scale, small features stay legible: tiny text is rotated and resized, but not sheared. Distortion is uniform in every direction, so shapes look "bent" rather than "smeared."

The playground warps images with a triangle mesh: the source square is divided into a grid of cells, every corner is pushed through ff, and each cell is painted with a clipped affine transform. Increase the mesh density with the slider for a smoother warp; lower it to see the triangles.

Some experiments to run with the sample cards and your own uploads:

  • z^2 on the face: the image is folded over itself along the real axis, and the face appears twice.
  • 1/z on the spiral: the spiral inverts into another spiral, and the centre blows up.
  • exp(z) on the test card: the vertical grid lines become circles.
  • (z - 1)/(z + 1) on the rings: circles that do not pass through the pole stay circles.
  • A shear in vector mode: the face leans, and every feature is smeared in one direction.
⚠

Outside the Möbius transformations there is no reason for a finite circle to stay a circle. Some lucky circles do — z2z^2 maps the unit circle to itself — but a general conformal map only turns infinitesimal circles into circles. The white hover circle in the playground is small but not infinitesimal, so it can look slightly oval under strong maps like z3z^3: that is the higher-order term, not a violation of conformality.

Where Conformality Earns Its Keep

  • Cartography. The Mercator projection is conformal: angles and small shapes are preserved, which is why it was indispensable for navigation. The price is enormous area distortion near the poles — Greenland looks like Africa.
  • Fluid dynamics. In 2D ideal flow, the complex potential Φ(z)\Phi(z) has streamlines and equipotential lines that meet at right angles. A conformal map preserves those angles, so a flow around a complicated obstacle can be computed by mapping it back to a simple one, such as a circle.
  • Electrostatics. The same complex-potential machinery turns boundary-value problems on awkward domains into problems on rectangles or disks.
  • Aerodynamics. The Joukowski map — and its generalizations — transforms a circle into an airfoil and gives closed-form lift predictions.
  • Mesh generation and graphics. Angle-preserving parameterizations keep texture and simulation meshes well-shaped. Conformal surface parameterization is a standard tool in geometry processing.
  • Statistical physics and field theory. Conformal invariance at critical points underlies conformal field theory and the study of percolation and other lattice models.
  • Medical imaging. Flattening the retina or the cortical surface uses conformal or near-conformal maps, so that local shapes and areas are distorted as little as possible.

In three and higher dimensions the story changes abruptly. Liouville's theorem says that for n≥3n \ge 3, every conformal map of a domain in Rn\mathbb{R}^n is a composition of translations, rotations, dilations, and inversions — the Möbius transformations. There is no room for the rich zoo of holomorphic functions. This is one reason two-dimensional conformal geometry is so special.

Conclusion

A conformal map is a deformation with no shear: at every point it is a rotation plus a uniform scale. In complex notation that is exactly what multiplication by f′(z)f'(z) does, and the Cauchy–Riemann equations are the coordinate-free statement of the same fact. The playground makes the definition operational — type a formula, watch the grid bend, hover to see the local rotation and scale, and read the distortion to see where conformality fails.

Dual numbers close the loop. They compute f′(z)f'(z) exactly from the same expression that draws the picture, which is why the local geometry can be displayed for arbitrary user formulas. If you want to go deeper into that machinery, the automatic differentiation article covers forward and reverse mode from scratch.

Further Reading

Related Articles

◆
·18 min read

Automatic Differentiation

A deep-dive into automatic differentiation: symbolic vs. numerical vs. AD, AST transformation, dual numbers, tapes, hybrid methods, and a generic C++ implementation that computes gradients and solves optimisation problems.