File Exchange

image thumbnail

Schwarz-Christoffel Toolbox

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


Updated 27 Nov 2020

From GitHub

View Version History

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 (2021). 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);


Jonas Allgeier

Wilson Wang

Andy Campbell

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

mark heimlich


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

Patrick Cross

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

Marina B.

Mohamed Nasser

Sam Kim

Boughrara kamel

there are not many documentation

Samina Kosar


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.

Anton Semechko

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 (

Charles Nelatury

Ali A

Izaak Beekman

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

Boughrara kamel

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

Boughrara kamel

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

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

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!