I know the basics of the Riemann mapping theorem, SC maps, etc. I can look up formulae for the maps from the half-plane to a triangle or rectangle. But I want a particularly nice explicit map--easily implementable in MATLAB--from a triangle with horizontal base to a rectangle aligned with the coordinate axes.* In particular, I want each of the sides of the triangle to map exactly to a side of the rectangle, so that it "unfolds".
I have played with the Schwarz-Christoffel toolbox for MATLAB but after some effort have not been able to get the result I want. The closest I've been able to get is using the command sequence
L = 128; ell = L/sqrt(12); p1 = polygon([-L/2-i*ell,L/2-i*ell,i*2*ell]); p2 = polygon(L/2*[-1-i,1-i,1+i,-1+i]); f1 = stripmap(p1,[1,2]) f2 = stripmap(p2,[1,2]) f1i = inv(f1) f2i = inv(f2) fc = composite(f1i,f2) n = 100; s = linspace(-L/2,L/2,n); t = linspace(-ell,2*ell,n); [x,y] = meshgrid(s,t); z = x+i*y; z = z(find(isinpoly(z,p1))); w = eval(fc,z); figure;scatter(real(z),imag(z),5,1:length(z),'filled') figure;scatter(real(w),imag(w),5,1:length(z),'filled')
...but this has a bizarre asymmetry that's presumably due to numerics, and (of much less concern) it's some nasty sort of involutionish thing away from how I want it. See below for the graphics. Most other variations I've tried have failed miserably.
*For convenience, we can take the triangle to be equilateral, but I really want a right triangle with shortest side aligned with the y-axis and length 1, and the next shortest side aligned with the x-axis and length 2.