General documentation and examples updates - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/demos/fractals.lua
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2011年10月27日 18:41:30 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2011年10月27日 18:41:30 +0200
commit485292c127db59762d50ae333270a8ad1ea32c3f (patch)
tree7c8b2b02ae0c00bf71f74d9cddb7d03b8520f6d2 /demos/fractals.lua
parentbe14a81e8187a069fc23845b4a9920b6b2bc0be8 (diff)
downloadgsl-shell-485292c127db59762d50ae333270a8ad1ea32c3f.tar.gz
General documentation and examples updates
Change contour function's names and load the module during initialization.
Diffstat (limited to 'demos/fractals.lua')
-rw-r--r--demos/fractals.lua 12
1 files changed, 8 insertions, 4 deletions
diff --git a/demos/fractals.lua b/demos/fractals.lua
index a5828316..84ceb3c1 100644
--- a/demos/fractals.lua
+++ b/demos/fractals.lua
@@ -1,16 +1,19 @@
-
-use 'stdlib'
+use 'math'
+use 'graph'
+use 'iter'
local function c_generator(n, n_angle, len_frac, g)
local exp, real, imag = complex.exp, complex.real, complex.imag
local w, r, k = ilist(|| 0, n+1), #g
local s = len_frac^n
- local sz = cnew(n_angle, 1, |k| s * exp(2i*pi*(k-1)/n_angle))
+ local sz = matrix.cnew(n_angle, 1, |k| s * exp(2i*pi*(k-1)/n_angle))
- local sh = ilist(|k| g[k%r+1] - g[(k-1)%r+1], 0, r-1)
+ local sh = ilist(|k| g[(k-1)%r+1] - g[(k-2)%r+1], r)
local a = (g[1]*n) % n_angle
+ print('sh', sh)
+
local z = 0
return function()
if w[n+1] == 0 then
@@ -18,6 +21,7 @@ local function c_generator(n, n_angle, len_frac, g)
z = z + sz[a+1]
for j=1,n+1 do
w[j] = (w[j] + 1) % r
+ print(j, w[j], sh[w[j]+1], a)
a = (a + sh[w[j]+1]) % n_angle
if w[j] ~= 0 then
break
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月27日 05:01:15 +0000

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