I'm trying to generate Riemann surfaces of higher order. I read How to visualize Riemann surfaces?, and the subsequent documents. I'm able to reproduce the surface using polar representation, but I'm having a difficult time generating them using rectangular coordinates, for roots greater then 2. So far what I have is:
p1 =
Plot3D[{Im[(x + I*y)^(1/2)], -Im[(x + I*y)^(1/2)]}, {x, -2, 2}, {y, -2, 2},
PlotPoints -> {40, 120}, Mesh -> 25, BoxRatios -> {2, 2, 2},
ColorFunction -> Function[{x, y, z}, Hue[z]]]
p2 =
ParametricPlot3D[
Evaluate[({r Cos[#1], 0, (r)^(1/3) Sin[#1/3]} &) /@ {0, π,2 π, 3 π}],
{r, 0, 2},
PlotStyle -> {{Black, AbsoluteThickness[5]}}]
Show[p1, p2]
Rectangular coordinates and branches in black
p3 =
ParametricPlot3D[{r Cos[φ], r Sin[φ], r^(1/2) Sin[φ/2]}, {r, 0, 1}, {φ, 0, 4 π},
ColorFunction ->
Function[{x, y, z, r, φ, θ}, {Specularity[#], Glow[#]}& @ Hue[Rescale[φ, {0, 1}]]],
PlotPoints -> {20, 60}, Mesh -> 25]
Show[p3, p2]
Polar coordinates with branches in black
The square roots are both identical. If I go on the cubic roots, the polar representation is the same with a change from 2 to 3, but I don't know how to modify the rectangular code to generate the same surface. So for example:
p4 =
ParametricPlot3D[{r Cos[φ], r Sin[φ], (r)^(1/3)Sin[φ/3]}, {r, 0, 1}, {φ, 0, 6 π},
ColorFunction ->
Function[{x, y, z, r, φ, θ}, {Specularity[#], Glow[#]}& @ Hue[Rescale[φ, {0, 1}]]],
PlotPoints -> {40, 120},
Mesh -> 25]
p5 =
ParametricPlot3D[
Evaluate[({r Cos[#1], 0, (r)^(1/3) Sin[#1/3]} &) /@ {0, π,2 π, 3 π, 4π, 5π}],
{r, 0, 2},
PlotStyle -> {{Black, AbsoluteThickness[5]}}]
Show[p4, p5]
Cubic root in polar with branches in black
I have no idea how to get the same cubic root surface using polar coordinates.