Group Abstract Group Abstract

Message Boards Message Boards

[GIF] :christmas_tree: (Conformal map of upper half-plane to triangle)

Conformal map of upper half-plane to triangle

:christmas_tree:

The Schwarz–Christoffel mappings are conformal transformations from the upper half-plane (or unit disk) to convex polygons; the existence of such maps is guaranteed by the Riemann Mapping Theorem. In general, these are somewhat challenging to compute/estimate, but in some cases they can be written down explicitly. For example, the following is an explicit Schwarz–Christoffel mapping to an equilateral triangle:

f[z_] := (E^((2 ? I)/3) Gamma[2/3])/(2^(1/3) Gamma[1/3] Gamma[4/3])
   (z - 1)^(1/3) Hypergeometric2F1[1/3, 2/3, 4/3, (1 - z)/2];

To make the animation, simply apply this map to the rectangular grid on the upper half-plane (and apply some cheats); the motion comes from sliding the vertical lines to the right.

Here's the code:

With[{r = 12., s = .67, cols = RGBColor /@ {"#f2f9f1", "#388e3c"}},
 Manipulate[
  Graphics[
   {cols[[1]],
    Polygon[{{s Cos[?/3] - 1, s Sin[?/3]}, {s Cos[2 ?/3], s Sin[?/3]}, {-1/2, Sqrt[3]/2}}],
    FaceForm[None], EdgeForm[Directive[cols[[1]], Thickness[.006]]],
    Polygon[{{0, 0}, {-1, 0}, {-1/2, Sqrt[3]/2}}],
    Thickness[.006], CapForm[None],
    Table[Line[Table[ReIm[f[t^3 + I y]], {t, -3., 3, 1/40}]], {y, 1, r}],
    Table[
     Line[Table[ReIm[f[x + I Exp[t]]], {t, -13., 4, 1/6}]],
     {x, -r + smootheststep[u], r + smootheststep[u], 1}]},
   ImageSize -> 540, Background -> cols[[2]],
   PlotRange -> {{-(6/5), 1/5}, {Sqrt[3]/4 - 7/10, Sqrt[3]/4 + 7/10}}],
  {u, 0, 1}]
 ]
4 Replies
Posted 6 years ago

@Clayton, I just wondered that it seems that the function smootheststep[ ] is not the embedded in Mathematica, and I lost all the lines when I copy your code in my notebook.

POSTED BY: yuema.bit
Posted 6 years ago

Yes, Clayton forgot to include the definition for that function:

smootheststep[t_] := -20 t^7 + 70 t^6 - 84 t^5 + 35 t^4

Alternatively, you could also try using ResourceFunction["SmootherStep"] from the Function Repository, or any of a number of other sigmoidal functions like

ssteprat = #^3/(1 - 3 # (1 - #)) &;
POSTED BY: J. M.

enter image description here - Congratulations! This post is now featured in our Staff Pick column as distinguished by a badge on your profile of a Featured Contributor! Thank you, keep it coming, and consider contributing your work to the The Notebook Archive!

POSTED BY: EDITORIAL BOARD
POSTED BY: Vitaliy Kaurov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard