Skip to main content
deleted 33 characters in body
Source Link
z := u + vI
g1 := -(3/2) Im[(z (1 - z^4))/(z^6 + z^3 \[Sqrt]5√5 - 1)]
g2 := -(3/2) Re[(z (1 + z^4))/(z^6 + z^3 \[Sqrt]5√5 - 1)]
g3 := Im[(1 + z^6)/(z^6 + z^3 \[Sqrt]5√5 - 1)] - 1/2
g = g1^2 + g2^2 + g3^2

ParametricPlot3D[
  {g1/g, g2/g, g3/g}, {u, 0, 0.5}, {v, 0, 0.5}
 ]

In the end, I want to end up with exactly this image, for which I've been unable to find the original code.

Edit: The 3 solutions provided here worked like a charm (with the caveat that the one using polar coordinates was weirdly sharped, and I couldn't fix that, but I'm a MathematicaMathematica newb), and I found another method:

ParametricPlot3D[Boys[u, v], {u, v} \[Element] Disk[{0, 0}, 1]1]]

I don't know why, but using RegionFunctionRegionFunction the surface rendered ~30% slower, and, using PiecewisePiecewise, about %5 slower. The only issue is that the mesh is now weirdly triangulated.

z := u + vI
g1 := -(3/2) Im[(z (1 - z^4))/(z^6 + z^3 \[Sqrt]5 - 1)]
g2 := -(3/2) Re[(z (1 + z^4))/(z^6 + z^3 \[Sqrt]5 - 1)]
g3 := Im[(1 + z^6)/(z^6 + z^3 \[Sqrt]5 - 1)] - 1/2
g = g1^2 + g2^2 + g3^2

ParametricPlot3D[
  {g1/g, g2/g, g3/g}, {u, 0, 0.5}, {v, 0, 0.5}
 ]

In the end I want to end up with exactly this image, for which I've been unable to find the original code.

Edit: The 3 solutions provided here worked like a charm (with the caveat that the one using polar coordinates was weirdly sharped, and I couldn't fix that, but I'm a Mathematica newb), and I found another method:

ParametricPlot3D[Boys[u, v], {u, v} \[Element] Disk[{0, 0}, 1]

I don't know why, but using RegionFunction the surface rendered ~30% slower, and, using Piecewise, about %5 slower. The only issue is that the mesh is now weirdly triangulated.

z := u + vI
g1 := -(3/2) Im[(z (1 - z^4))/(z^6 + z^3 √5 - 1)]
g2 := -(3/2) Re[(z (1 + z^4))/(z^6 + z^3 √5 - 1)]
g3 := Im[(1 + z^6)/(z^6 + z^3 √5 - 1)] - 1/2
g = g1^2 + g2^2 + g3^2

ParametricPlot3D[{g1/g, g2/g, g3/g}, {u, 0, 0.5}, {v, 0, 0.5}]

In the end, I want to end up with exactly this image, for which I've been unable to find the original code.

Edit: The 3 solutions provided here worked like a charm (with the caveat that the one using polar coordinates was weirdly sharped, and I couldn't fix that, but I'm a Mathematica newb), and I found another method:

ParametricPlot3D[Boys[u, v], {u, v}  Disk[{0, 0}, 1]]

I don't know why, but using RegionFunction the surface rendered ~30% slower, and, using Piecewise, about %5 slower. The only issue is that the mesh is now weirdly triangulated.

added 1963 characters in body
Source Link

Edit: The 3 solutions provided here worked like a charm (with the caveat that the one using polar coordinates was weirdly sharped, and I couldn't fix that, but I'm a Mathematica newb), and I found another method:

ParametricPlot3D[Boys[u, v], {u, v} \[Element] Disk[{0, 0}, 1]

I don't know why, but using RegionFunction the surface rendered ~30% slower, and, using Piecewise, about %5 slower. The only issue is that the mesh is now weirdly triangulated.

Also, I compiled the actual parametric formula and performance increased threefold:

Boys = Compile[{u, 
v}, {(-(3/2)
    Im[((u + v I) (1 - (u + v I)^4))/((u + 
      v I)^6 + (u + v I)^3 Sqrt[5] - 1.)])/((-(3/2)
     Im[((u + v I) (1 - (u + v I)^4))/((u + 
       v I)^6 + (u + v I)^3 Sqrt[5] - 1.)])^2 + (-(3/2)
     Re[((u + v I) (1 + (u + v I)^4))/((u + 
       v I)^6 + (u + v I)^3 Sqrt[5] - 1.)])^2 + (Im[(
    1 + (u + v I)^6)/((u + v I)^6 + (u + v I)^3 Sqrt[5] - 1.)] - 
   1/2)^2), (-(3/2)
    Re[((u + v I) (1 + (u + v I)^4))/((u + 
      v I)^6 + (u + v I)^3 Sqrt[5] - 1.)])/((-(3/2)
     Im[((u + v I) (1 - (u + v I)^4))/((u + 
       v I)^6 + (u + v I)^3 Sqrt[5] - 1.)])^2 + (-(3/2)
     Re[((u + v I) (1 + (u + v I)^4))/((u + 
       v I)^6 + (u + v I)^3 Sqrt[5] - 1.)])^2 + (Im[(
    1 + (u + v I)^6)/((u + v I)^6 + (u + v I)^3 Sqrt[5] - 1.)] - 
   1/2)^2), (Im[(
   1 + (u + v I)^6)/((u + v I)^6 + (u + v I)^3 Sqrt[5] - 1.)] - 1/
  2)/((-(3/2)
     Im[((u + v I) (1 - (u + v I)^4))/((u + 
       v I)^6 + (u + v I)^3 Sqrt[5] - 1.)])^2 + (-(3/2)
     Re[((u + v I) (1 + (u + v I)^4))/((u + 
       v I)^6 + (u + v I)^3 Sqrt[5] - 1.)])^2 + (Im[(
    1 + (u + v I)^6)/((u + v I)^6 + (u + v I)^3 Sqrt[5] - 1.)] - 
   1/2)^2)}, Parallelization -> True];

I also tried compiling each of $g1,g2,g3,g$ separately, but performance was a bit worse.

Edit: The 3 solutions provided here worked like a charm (with the caveat that the one using polar coordinates was weirdly sharped, and I couldn't fix that, but I'm a Mathematica newb), and I found another method:

ParametricPlot3D[Boys[u, v], {u, v} \[Element] Disk[{0, 0}, 1]

I don't know why, but using RegionFunction the surface rendered ~30% slower, and, using Piecewise, about %5 slower. The only issue is that the mesh is now weirdly triangulated.

Also, I compiled the actual parametric formula and performance increased threefold:

Boys = Compile[{u, 
v}, {(-(3/2)
    Im[((u + v I) (1 - (u + v I)^4))/((u + 
      v I)^6 + (u + v I)^3 Sqrt[5] - 1.)])/((-(3/2)
     Im[((u + v I) (1 - (u + v I)^4))/((u + 
       v I)^6 + (u + v I)^3 Sqrt[5] - 1.)])^2 + (-(3/2)
     Re[((u + v I) (1 + (u + v I)^4))/((u + 
       v I)^6 + (u + v I)^3 Sqrt[5] - 1.)])^2 + (Im[(
    1 + (u + v I)^6)/((u + v I)^6 + (u + v I)^3 Sqrt[5] - 1.)] - 
   1/2)^2), (-(3/2)
    Re[((u + v I) (1 + (u + v I)^4))/((u + 
      v I)^6 + (u + v I)^3 Sqrt[5] - 1.)])/((-(3/2)
     Im[((u + v I) (1 - (u + v I)^4))/((u + 
       v I)^6 + (u + v I)^3 Sqrt[5] - 1.)])^2 + (-(3/2)
     Re[((u + v I) (1 + (u + v I)^4))/((u + 
       v I)^6 + (u + v I)^3 Sqrt[5] - 1.)])^2 + (Im[(
    1 + (u + v I)^6)/((u + v I)^6 + (u + v I)^3 Sqrt[5] - 1.)] - 
   1/2)^2), (Im[(
   1 + (u + v I)^6)/((u + v I)^6 + (u + v I)^3 Sqrt[5] - 1.)] - 1/
  2)/((-(3/2)
     Im[((u + v I) (1 - (u + v I)^4))/((u + 
       v I)^6 + (u + v I)^3 Sqrt[5] - 1.)])^2 + (-(3/2)
     Re[((u + v I) (1 + (u + v I)^4))/((u + 
       v I)^6 + (u + v I)^3 Sqrt[5] - 1.)])^2 + (Im[(
    1 + (u + v I)^6)/((u + v I)^6 + (u + v I)^3 Sqrt[5] - 1.)] - 
   1/2)^2)}, Parallelization -> True];

I also tried compiling each of $g1,g2,g3,g$ separately, but performance was a bit worse.

Tweeted twitter.com/#!/StackMma/status/594394035592273920
edited tags
Link
added 6 characters in body
Source Link
Loading
Source Link
Loading