Author Topic: Henon translation  (Read 378 times)

B+

  • Full Member
  • ***
  • Posts: 215
    • View Profile
Henon translation
« on: August 29, 2016 »
Code: [Select]
'Henon translation [B+=MGA] 2016-08-28

xmax = 800
ymax = 600
set window 100, 40, xmax, ymax
radians
set redraw off

a# = -10.1 ; sc# = 175.0 ; ox# = 400.0 ; oy# = 300.0
while a# < 100.0
set colori 0
draw rect 0, 0, 800, 600, true
x# = -0.1
while x# < 0.8
x# = x# + 0.05
y# = -0.1
while y# < 0.8
y# = y# + 0.05
lx# = x# ; ly# = y#
for n =1 to 40
xx# = lx# * cos(a) - (ly# - lx# * lx#) * sin(a#)
ly# = lx# * sin(a) + (ly# - lx# * lx#) * cos(a#)
lx# = xx#
if abs(int(lx#) + int(ly#)) > 3000 then n = 41
set color n * 5, 255 - n * 5, 128 + n * 2
set pixel int(ly# * sc# + ox#), int(lx# * sc# + oy#)
next
wend
wend
redraw
  a# = a# + 0.001
sc# = sc# + 0.01
wend
B+

Marcus

  • Administrator
  • Hero Member
  • *****
  • Posts: 542
    • View Profile
Re: Henon translation
« Reply #1 on: August 30, 2016 »
God, that's sexy!    O0
.\\\opz