Fixed plot3d module to use 2.0 modules' structure - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/plot3d.lua
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2011年08月09日 10:16:54 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2011年08月09日 10:16:54 +0200
commit7a1a1607cb6d186480fe662088b4e62be0a561f9 (patch)
tree1087e22eb97cd77a08bd4c4cbd719a3f95844050 /plot3d.lua
parent3371160ef86992eae3092d06676a4396e1666ebf (diff)
downloadgsl-shell-7a1a1607cb6d186480fe662088b4e62be0a561f9.tar.gz
Fixed plot3d module to use 2.0 modules' structure
Diffstat (limited to 'plot3d.lua')
-rw-r--r--plot3d.lua 13
1 files changed, 8 insertions, 5 deletions
diff --git a/plot3d.lua b/plot3d.lua
index 8d6317a2..8e8756b2 100644
--- a/plot3d.lua
+++ b/plot3d.lua
@@ -2,6 +2,9 @@
local Pre3d = require 'pre3d/pre3d'
local ShapeUtils = require 'pre3d/pre3d_shape_utils'
+local pi = math.pi
+local rgb = graph.rgb
+
local function opt_gener(options, defaults)
return function(name)
local t = (options and options[name]) and options or defaults
@@ -17,7 +20,7 @@ local function set_transform(ct, rx, ry, dz)
ct:translate(0, 0, dz and -dz or -80)
end
-function render_shape(shape, plt, stroke)
+local function render_shape(shape, plt, stroke)
local renderer = Pre3d.Renderer(plt)
renderer.draw_overdraw = true
@@ -38,10 +41,10 @@ function render_shape(shape, plt, stroke)
return renderer
end
-function plot3d(f, x1, y1, x2, y2, options)
+function graph.plot3d(f, x1, y1, x2, y2, options)
local opt = opt_gener(options, {title= 'Pre3d', gridx= 20, gridy= 20})
- local plt = plot(opt 'title')
+ local plt = graph.plot(opt 'title')
local nx = opt 'gridx'
local ny = opt 'gridy'
@@ -53,10 +56,10 @@ function plot3d(f, x1, y1, x2, y2, options)
return plt
end
-function surfplot(fs, u1, v1, u2, v2, options)
+function graph.surfplot(fs, u1, v1, u2, v2, options)
local opt = opt_gener(options, {title= 'Pre3d', gridu= 20, gridv= 20})
- local plt = plot(opt 'title')
+ local plt = graph.plot(opt 'title')
local nu = opt 'gridu'
local nv = opt 'gridv'
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月27日 20:31:53 +0000

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