Initial release of Maemo 5 port of gnuplot
[gnuplot] / demo / singulr.dem
1 # $Id: singulr.dem,v 1.6 2003/10/28 05:35:54 sfeam Exp $
2 #
3 # Demo that plots some surfaces with singularities.
4 # Author: Carsten Steger
5 #
6 # (x,y,x^2-y^2,2xy) is the graph of w=z^2 in 4-space.
7 # Therefore (x^2-y^2,2xy,x,y) is the graph of w=sqrt(z) in 4-space.
8 # Coordinates 1, 2, and 3 give the real part of either function,
9 # whereas coordinates 1, 2, and 4 give the imaginary part.
10 # The same holds for the cube function w=z^3. The graphs are given by
11 # (x,y,x^3-3xy^2,3x^2y-y^3) and (x^3-3xy^2,3x^2y-y^3,x,y).
12 # And so on...
13
14
15 set parametric
16 set hidden3d
17 set isosamples 21
18 set autoscale
19
20
21 set view 60,30
22 set urange [-3:3]
23 set vrange [-3:3]
24 set title "Real part of complex square root function"
25 splot u**2-v**2,2*u*v,u
26 pause -1 "Hit return to continue (1)"
27
28
29 set view 60,210
30 set title "Real part of complex square root function (different view)"
31 replot
32 pause -1 "Hit return to continue (2)"
33
34
35 set view 60,120
36 set urange [-3:3]
37 set vrange [-3:3]
38 set title "Imaginary part of complex square root function"
39 splot u**2-v**2,2*u*v,v
40 pause -1 "Hit return to continue (3)"
41
42
43 set view 60,300
44 set title "Imaginary part of complex square root function (different view)"
45 replot
46 pause -1 "Hit return to continue (4)"
47
48
49 set view 60,30
50 set urange [-3:3]
51 set vrange [-3:3]
52 set title "Real part of complex cube root function"
53 splot u**3-3*u*v**2,3*u**2*v-v**3,u
54 pause -1 "Hit return to continue (5)"
55
56
57 set view 60,210
58 set title "Real part of complex cube root function (different view)"
59 replot
60 pause -1 "Hit return to continue (6)"
61
62
63 set view 60,30
64 set urange [-3:3]
65 set vrange [-3:3]
66 set title "Imaginary part of complex cube root function"
67 splot u**3-3*u*v**2,3*u**2*v-v**3,v
68 pause -1 "Hit return to continue (7)"
69
70
71 set view 60,210
72 set title "Imaginary part of complex cube root function (different view)"
73 replot
74 pause -1 "Hit return to continue (8)" 
75
76
77 set view 60,30
78 set isosamples 31
79 set urange [-1:1]
80 set vrange [-1:1]
81 set title "Real part of complex 4th root function"
82 splot u**4-6*u**2*v**2+v**4,4*u**3*v-4*u*v**3,u
83 pause -1 "Hit return to continue (9)"
84
85
86 set view 60,210
87 set title "Real part of complex 4th root function (different view)"
88 replot
89 pause -1 "Hit return to continue (10)"
90
91
92 set view 60,120
93 set urange [-1:1]
94 set vrange [-1:1]
95 set title "Imaginary part of complex 4th root function"
96 splot u**4-6*u**2*v**2+v**4,4*u**3*v-4*u*v**3,v
97 pause -1 "Hit return to continue (11)"
98
99
100 set view 60,300
101 set title "Imaginary part of complex 4th root function (different view)"
102 replot
103 pause -1 "Hit return to continue (12)"
104
105
106 set isosamples 21
107 set view 60,20
108 set urange [-3:3]
109 set vrange [-3:3]
110 set title "Enneper's surface"
111 splot u-u**3/3+u*v**2,v-v**3/3+v*u**2,u**2-v**2
112 pause -1 "Hit return to continue (13)"
113
114
115 set view 60,110
116 set title "Enneper's surface (different view)"
117 replot
118 pause -1 "Hit return to continue (14)"
119
120
121 set isosamples 31,11
122 set view 60,30
123 set title "Moebius strip"
124 set urange [0:2*pi]
125 set vrange [-0.25:0.25]
126 splot (2-v*sin(u/2))*sin(u),(2-v*sin(u/2))*cos(u),v*cos(u/2)
127 pause -1 "Hit return to continue (15)"
128
129
130 set view 60,210
131 set title "Moebius strip (view from opposite side)"
132 replot
133 pause -1 "Hit return to continue (16)"
134
135 unset key
136 set xrange [-10:10]
137 set yrange [-10:10]
138 set zrange [-3:3]
139 set urange [0:2*pi]
140 set vrange [0:2*pi]
141 set isosamples 39,60
142 set view 60,120
143 set title "Klein bottle"
144 splot  (2*sin(u)*cos(v/2)-sin(2*u)*sin(v/2)+8)*cos(v), \
145        (2*sin(u)*cos(v/2)-sin(2*u)*sin(v/2)+8)*sin(v), \
146         2*sin(u)*sin(v/2)+sin(2*u)*cos(v/2)
147 pause -1 "Hit return to continue (17)"
148
149
150 set urange [0:2*pi]
151 set vrange [0:4*pi/3]
152 set isosamples 39,40
153 set view 60,20
154 set title "Klein bottle with look at the 'inside'"
155 replot
156 pause -1 "Hit return to continue (18)"
157
158 set style data lines
159 set xrange [-12:12]
160 set yrange [-12:12]
161 set zrange [*:*]
162 unset hidden3d
163 set ticslevel 0.
164 set view 50,15  #HBB: ,1,1.7
165 set title "Klein bottle, glassblowers' version (look-through)"
166 splot "klein.dat"
167 pause -1 "Hit return to continue (19)"
168
169
170 set hidden3d
171 set view 70,305
172 set title "Klein bottle, glassblowers' version (solid)"
173 splot "klein.dat"
174 pause -1 "Hit return to continue (20)"
175
176 reset