File: singulr.dem

package info (click to toggle)
gnuplot 3.5beta6.347-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 5,032 kB
  • ctags: 4,235
  • sloc: ansic: 42,086; makefile: 561; asm: 539; sh: 386; objc: 379; csh: 297; pascal: 194; perl: 138; lisp: 88
file content (176 lines) | stat: -rw-r--r-- 4,084 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# $Id: singulr.dem,v 1.3 1995/12/11 23:14:19 drd Exp $
#
# Demo that plots some surfaces with singularities.
# Author: Carsten Steger
#
# (x,y,x^2-y^2,2xy) is the graph of w=z^2 in 4-space.
# Therefore (x^2-y^2,2xy,x,y) is the graph of w=sqrt(z) in 4-space.
# Coordinates 1, 2, and 3 give the real part of either function,
# whereas coordinates 1, 2, and 4 give the imaginary part.
# The same holds for the cube function w=z^3. The graphs are given by
# (x,y,x^3-3xy^2,3x^2y-y^3) and (x^3-3xy^2,3x^2y-y^3,x,y).
# And so on...


set parametric
set hidden3d
set isosamples 21
set autoscale


set view 60,30
set urange [-3:3]
set vrange [-3:3]
set title "Real part of complex square root function"
splot u**2-v**2,2*u*v,u
pause -1 "Hit return to continue (1)"


set view 60,210
set title "Real part of complex square root function (different view)"
replot
pause -1 "Hit return to continue (2)"


set view 60,120
set urange [-3:3]
set vrange [-3:3]
set title "Imaginary part of complex square root function"
splot u**2-v**2,2*u*v,v
pause -1 "Hit return to continue (3)"


set view 60,300
set title "Imaginary part of complex square root function (different view)"
replot
pause -1 "Hit return to continue (4)"


set view 60,30
set urange [-3:3]
set vrange [-3:3]
set title "Real part of complex cube root function"
splot u**3-3*u*v**2,3*u**2*v-v**3,u
pause -1 "Hit return to continue (5)"


set view 60,210
set title "Real part of complex cube root function (different view)"
replot
pause -1 "Hit return to continue (6)"


set view 60,30
set urange [-3:3]
set vrange [-3:3]
set title "Imaginary part of complex cube root function"
splot u**3-3*u*v**2,3*u**2*v-v**3,v
pause -1 "Hit return to continue (7)"


set view 60,210
set title "Imaginary part of complex cube root function (different view)"
replot
pause -1 "Hit return to continue (8)" 


set view 60,30
set isosamples 31
set urange [-1:1]
set vrange [-1:1]
set title "Real part of complex 4th root function"
splot u**4-6*u**2*v**2+v**4,4*u**3*v-4*u*v**3,u
pause -1 "Hit return to continue (9)"


set view 60,210
set title "Real part of complex 4th root function (different view)"
replot
pause -1 "Hit return to continue (10)"


set view 60,120
set urange [-1:1]
set vrange [-1:1]
set title "Imaginary part of complex 4th root function"
splot u**4-6*u**2*v**2+v**4,4*u**3*v-4*u*v**3,v
pause -1 "Hit return to continue (11)"


set view 60,300
set title "Imaginary part of complex 4th root function (different view)"
replot
pause -1 "Hit return to continue (12)"


set isosamples 21
set view 60,20
set urange [-3:3]
set vrange [-3:3]
set title "Enneper's surface"
splot u-u**3/3+u*v**2,v-v**3/3+v*u**2,u**2-v**2
pause -1 "Hit return to continue (13)"


set view 60,110
set title "Enneper's surface (different view)"
replot
pause -1 "Hit return to continue (14)"


set isosamples 31,11
set view 60,30
set title "Moebius strip"
set urange [0:2*pi]
set vrange [-0.25:0.25]
splot (2-v*sin(u/2))*sin(u),(2-v*sin(u/2))*cos(u),v*cos(u/2)
pause -1 "Hit return to continue (15)"


set view 60,210
set title "Moebius strip (view from opposite side)"
replot
pause -1 "Hit return to continue (16)"

set nokey
set xrange [-10:10]
set yrange [-10:10]
set zrange [-3:3]
set urange [0:2*pi]
set vrange [0:2*pi]
set isosamples 39,60
set view 60,120
set title "Klein bottle"
splot  (2*sin(u)*cos(v/2)-sin(2*u)*sin(v/2)+8)*cos(v), \
       (2*sin(u)*cos(v/2)-sin(2*u)*sin(v/2)+8)*sin(v), \
        2*sin(u)*sin(v/2)+sin(2*u)*cos(v/2)
pause -1 "Hit return to continue (17)"


set urange [0:2*pi]
set vrange [0:4*pi/3]
set isosamples 39,40
set view 60,20
set title "Klein bottle with look at the 'inside'"
replot
pause -1 "Hit return to continue (18)"

set data style lines
set xrange [-12:12]
set yrange [-12:12]
set zrange [*:*]
set ticslevel 0.5
set nohidden3d
set view 50,15,1,1.7
set title "Klein bottle, glassblowers' version (look-through)"
splot "klein.dat"
pause -1 "Hit return to continue (19)"


set hidden3d
set view 70,305
set title "Klein bottle, glassblowers' version (solid)"
splot "klein.dat"
pause -1 "Hit return to continue (20)"

reset