GSL Interpolation functions implemented - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/examples/interp.lua
diff options
context:
space:
mode:
authorfrancesco-ST <francesco.abbate@st.com>2010年09月23日 18:18:07 +0200
committerfrancesco-ST <francesco.abbate@st.com>2010年09月23日 18:18:07 +0200
commit16800ab30b0f9c2ef352fa0509ddfd6091917270 (patch)
tree2f1dbdb78c7d9c0041c532a984e6986cea89cdb4 /examples/interp.lua
parente82a04315810be635ccb66840fab5de8a5138556 (diff)
downloadgsl-shell-16800ab30b0f9c2ef352fa0509ddfd6091917270.tar.gz
GSL Interpolation functions implemented
Diffstat (limited to 'examples/interp.lua')
-rw-r--r--examples/interp.lua 14
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/interp.lua b/examples/interp.lua
new file mode 100644
index 00000000..f0a0d013
--- /dev/null
+++ b/examples/interp.lua
@@ -0,0 +1,14 @@
+function demo1()
+ local N = 8
+ local xsmp = |k| 2*pi*(k-1)/N
+ local x, y = new(N, 1, xsmp), new(N, 1, |k| sin(xsmp(k)))
+ local p = plot 'interp'
+ p:show()
+ p:addline(xyline(x, y))
+ local ap = interp('akima', x, y)
+ p:addline(fxline(|x| ap:eval(x), 0, 2*pi), 'blue', {{'dash', 7, 3, 3, 3}})
+ return p, ap
+end
+
+print 'demo1() - Akima interpolation of simple sine data'
+
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月28日 15:02:43 +0000

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