File: gnuplot.rot

package info (click to toggle)
gnuplot 5.4.1%2Bdfsg1-1%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,316 kB
  • sloc: ansic: 85,877; cpp: 7,440; makefile: 2,548; javascript: 2,322; sh: 1,542; lisp: 667; perl: 304; pascal: 191; tcl: 88; python: 46
file content (43 lines) | stat: -rw-r--r-- 1,555 bytes parent folder | download | duplicates (5)
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
# A generic rotation routine for the gnuplot demos.  In the commands
# that load this file, the following should be defined:
#
# iteration_count:  set iteration_count=0
#
# iteration_delay:  pause between frames of iteration (defaults to 0.1 sec)
#
# limit_iterations:  if set to a nonzero value, it'll stop after that
#     many iterations; if zero value, continues indefinitely
#
# xrot:  the initial x rotation of the view
#
# xrot_delta:  the amount to increment the x rotation for each new plot
#
# xview:  function for generating x view value; for example
#     xview(xrot)=(50.+30.*sin((xrot%180)/180.*pi))
#
# zrot:  the initial z rotation of the view
#
# zrot_delta:  the amount to increment the z rotation for each new plot
#
# zview:  function for generating z view value; for example
#     zview(zrot)=(60.+45.*sin(zrot/180.*pi))
#
# History:
#   - 1. 1. 2006 Dan Sebald:  Made more generic so other demos could use
#   - ?. ?. ?    Hans-Bernhard Broeker:  Used to just turn round and round
#                by somewhat large steps. Now, it tumbles back and forth
#                smoothly.
#   - ?. ?. ?    ?:  Initial recursive script
#     Nov 2017	Switch to version 5 iteration syntax rather than reread
#		Add timed pause

if (!(exists("iteration_delay"))) iteration_delay = 0.1

while ((!limit_iterations) || (iteration_count<=limit_iterations)) {
    set view xview(xrot), zview(zrot)
    replot
    zrot = (zrot+zrot_delta) % 360
    xrot = (xrot+xrot_delta) % 360
    iteration_count = iteration_count + 1
    pause iteration_delay
}