Removed the conditionals to compile without complex LNUM extension. - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/module/draw.lua
diff options
context:
space:
mode:
authorfrancesco-ST <francesco.abbate@st.com>2011年02月01日 13:16:26 +0100
committerfrancesco-ST <francesco.abbate@st.com>2011年02月01日 13:16:26 +0100
commitef33d2e7047f2092d3c99d969b465201a831b6e6 (patch)
treef07055dcfae5988cec5566b5d0289b1f58a38d0a /module/draw.lua
parentbd2c1b886cfe9b69a2f8491e700d00639303f798 (diff)
downloadgsl-shell-ef33d2e7047f2092d3c99d969b465201a831b6e6.tar.gz
Removed the conditionals to compile without complex LNUM extension.
The conditionals are no more needed because now the complex number are implemented using an unmodified Lua VM implementation.
Diffstat (limited to 'module/draw.lua')
-rw-r--r--module/draw.lua 75
1 files changed, 0 insertions, 75 deletions
diff --git a/module/draw.lua b/module/draw.lua
deleted file mode 100644
index 5ac83be0..00000000
--- a/module/draw.lua
+++ /dev/null
@@ -1,75 +0,0 @@
-
-require 'module/igsl'
-
-draw = {}
-
-function draw.ipath(f)
- local ln = gsl.path()
- ln:move_to(f())
- for x, y in f do
- ln:line_to(x, y)
- end
- return ln
-end
-
-function draw.ipathp(f)
- local ln = gsl.path()
- local success = false
- local x, y
- repeat
- local cont = success
- success, x, y = pcall(f)
- if success and x and y then
- if cont then
- ln:line_to(x, y)
- else
- ln:move_to(x, y)
- end
- end
- until success and (not x or not y)
- return ln
-end
-
-function draw.fxline(f, xi, xs, n)
- n = n and n or 512
- return draw.ipath(gsl.sample(f, xi, xs, n))
-end
-
-function draw.fxplot(f, xi, xs, color, n)
- n = n and n or 512
- color = color and color or 'red'
- local p = gsl.plot()
- p:add_line(draw.ipathp(gsl.sample(f, xi, xs, n)), color)
- p:show()
- return p
-end
-
-local function add_bar(p, lx, rx, y)
- p:move_to(lx, 0)
- p:line_to(rx, 0)
- p:line_to(rx, y)
- p:line_to(lx, y)
- p:close()
-end
-
-function draw.ibars(f)
- local b = gsl.path()
- local lx, ly = f()
- local first = true
- for rx, ry in f do
- local dx = (rx-lx)/2
- if first then add_bar(b, lx-dx, lx+dx, ly); first = false end
- add_bar(b, lx+dx, rx+dx, ry)
- lx, ly = rx, ry
- end
- return b
-end
-
-local bcolors = {'red', 'green', 'blue', 'cyan', 'magenta', 'yellow'}
-local mcolors = {'dark', '', 'light'}
-
-function draw.rainbow(n)
- local p = #bcolors
- local q = floor(n/p) % #mcolors
- return mcolors[q+1] .. bcolors[n % p + 1]
-end
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月26日 19:42:13 +0000

AltStyle によって変換されたページ (->オリジナル) /