# MATLAB: Compute the Schwarz-Christoffel transformation symbolically

Suppose we have a conformal mapping from the unit disk in the $$\omega$$ plane onto the exterior of a polygon in the $$z$$ plane.

The Schwarz-Christoffel mapping in this case is defined as: $$f(u) = A - C \int^u w^{-2}\prod_{k=1}^{n} (1-\frac{\omega}{u_k})^{1-\alpha_k} d\omega.$$

Meaning that we determine the vertex $$z_k$$ with the mapping $$f(u_k)$$ from the respective prevertex.

I have provided an image from Discroll and Trefethens' book on the subject (PDF sample with the image is freely available).

I would like to compute a factor from an integral over function analytic inside a polygon in the complex plane.

For this I will use Gauss-Kronrod quadrature, specifically MATLAB's quadgk command with 'waypoints'

I ll just pick my function arbitrarily as $$g = \exp(z)$$.

What I want to compute is:

$$\int{\frac{\exp(f(u))}{u}}du$$

To use quadgk I have to define a function handle for $$g$$. But I am confused on how to do that with the SC-Mapping f(u). I know I can extract the prevertices and interior angles $$\alpha_k$$ with the SC-toolbox for any polygon like so:

PSI = extermap(drawpoly)
p = polygon(PSI);
a = parameters(PSI);

1. How do I compute the integral $$\int^u w^{-2}\prod_{k=1}^{n} (1-\frac{\omega}{u_k})^{1-\alpha_k} d\omega$$ ? It's a polygonal integral in the complex plane so should I use quadgk as well ?
2. How do I set the complex constants $$A$$ and $$C$$ ?

b = a.constant

seems to refer to the logarithmic capacity of the polygonal domain.