File Exchange

image thumbnail

Schwarz-Christoffel Toolbox

version (381 KB) by Toby Driscoll
Computes conformal maps to polygons, allowing easy solution of Laplace's equation.


Updated 14 Jun 2018

GitHub view license on GitHub

The Schwarz-Christoffel transformation is a recipe for a conformal map to a region bounded by a polygon. They can be computed to very high accuracy in little time. These maps can make certain Laplace boundary value problems trivial to solve on such domains.
p = polygon([0 i -1+i -1-i 1-i 1]); % L-shaped region
f = diskmap(p); % find map
plot(f) % visualize it
phi = lapsolve(p,[1 nan 4 3 nan 2]); % solve a BVP
[t,x,y] = triangulate(p);
trisurf(t,x,y,phi(x+i*y)); % see it

Cite As

Toby Driscoll (2020). Schwarz-Christoffel Toolbox (, GitHub. Retrieved .

Comments and Ratings (23)


Cannot excute function 'evaldiff()' in r2019b, how to solve it?

Undefined function 'crembed' for input arguments of type 'struct'.

Error in crrderiv (line 37)
z = crembed(cr,Q,q);

Error in crrectmap/evaldiff (line 36)
fp = crrderiv(zp,w,beta,wr,betar,cr,aff,affr,Q,qdata,qdatar);


Wilson Wang

Nice entry. It was in part inspiration for this blog post:


I have a problem with this polygon:
q = polygon([0,1+i,3+i,3]);
If you could help me in some way it would be great.

Thank you for the attention

Hello, has anyon had issue using this toolbox in 2015b?

Marina B.

Sam Kim

there are not many documentation


i am interested to draw like this in SC-Toolbox, can anyone help me in this regards, the example explained about is for bounded polygon, could you please describe the same map for my figer. please dont take it as dashes, its line two lines having angle 90 degree.

This implementation saved me a bunch of time. Thanks a lot!

P.S. - Any one who needs documentation for this toolbox can find it on Toby's website (

Ali A

Indispensable! Saved so much time using this rather than coding up everything in Fortran!

I have sent to you an example to the polygone where i have severe crowding. Could you give me answer and your opignon.

I have used the toolbox and it is excellent.
I have some problems with crowding for some polygon.
I will send you the polygon where i have the problem.

Al van Deursen

I used the software on many instances and found its results in excellent agreement with practical experiments. Wrote a few scientific papers using the results.
Documentation on Driscoll's personal webpage was more than sufficient for somebody with knowledge in basic calculus and Schwarz - Christoffel analysis.

pepe sanchez


lv dc

3x, i need test it first.

Francisco Tejo

Paolo Novati


Now accessing the Github repository.

Previous resubmission was missing critical files.

Fixes an incompatibility (bug?) with matlab release 2007a.

Changes for compatability with MATLAB 6.5.

New routine for solving Laplace's equation.

Changes for compatability with MATLAB 6.5.

New routine for solving Laplace's equation.

Minor bug fixes. No enhancements.

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux