summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/asymptote/examples/partialsurface.asy
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/asymptote/examples/partialsurface.asy')
-rw-r--r--Master/texmf-dist/doc/asymptote/examples/partialsurface.asy29
1 files changed, 29 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/asymptote/examples/partialsurface.asy b/Master/texmf-dist/doc/asymptote/examples/partialsurface.asy
new file mode 100644
index 00000000000..2e8ad34d834
--- /dev/null
+++ b/Master/texmf-dist/doc/asymptote/examples/partialsurface.asy
@@ -0,0 +1,29 @@
+import graph3;
+import palette;
+
+size(0,300);
+currentprojection=perspective(3,-2,2);
+
+real V(real r) {return r^4-r^2;}
+real V(pair pos) {return V(abs(pos));}
+
+real R=1/sqrt(2);
+real z=-0.2;
+
+bool active(pair pos) {return abs(pos) < R;}
+bool above(pair pos) {return V(pos) >= z;}
+
+pair a=(-1.5,-1);
+pair b=(0.5,1);
+real f=1.2;
+
+draw(plane(f*(b.x-a.x,0,z),(0,f*(b.y-a.y),z),(a.x,a.y,z)),
+ lightgrey+opacity(0.5));
+
+surface s=surface(V,a,b,40,Spline,active);
+draw(s,mean(palette(s.map(new real(triple v) {
+ return above((v.x,v.y)) ? 1 : 0;}),
+ new pen[] {lightblue,lightgreen})),black);
+
+xaxis3(Label("$\phi^\dagger\phi$",1),red,Arrow3);
+zaxis3(Label("$V(\phi^\dagger\phi)$",1),0,0.3,red,Arrow3);