fit iterated linear/quadratic functions over consecutive
coordinates. The logic been that we can apply
the Q matrix method if a relation is found. But, it didn't
work out. Then, I searched on google
and found that the Dragon fractal is somehow related
to base i-1 representations .... but I still fail to make the connection
and cannot decipher the tcl/tk code on this page ...
http://wiki.tcl.tk/10761
What is it trying to do here? Is there some iterated function
system which generates consecutive coordinates ? Or does
conversion of n into base i-1 give the bits of the turns?
Code: Select all
set y [list 1 0]
set powers {}
for { set i 0 } { $i < 32 } { incr i } {
lappend powers $y
foreach { a b } $y break
set y [list [expr { -$a - $b }] \
[expr { $a - $b }]]
}
proc penney { from to color } {
variable powers
set cmd [list .c create line]
for { set i $from } { $i <= $to } { incr i } {
set b 1
set re 0
set im 0
foreach bit $powers {
if { $i & $b } {
foreach { br bi } $bit break
incr re $br
incr im $bi
}
if { $b >= $i } {
break
}
incr b $b
}
lappend cmd [expr {128+3*$re}] [expr {108-3*$im}]
}
lappend cmd -fill $color
eval $cmd
}