Some lissajoux figures to play with (iPad only)

Post Reply
Henko
Posts: 814
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Some lissajoux figures to play with (iPad only)

Post by Henko »

Code: Select all

graphics ! graphics clear .8,.8,.8
d=56 ! option angle degrees
fill color .8,.8,.8 ! draw color 0,0,0
for i=0 to 2 ! for j=0 to 1
  box(d+j*(300+d),20+i*320,300,300,.5,.5,15)
  draw color 0,0,0 ! draw size 1 ! shadow on
  xo=0 ! yo=0
  for a=0 to 720 step 2
    x=9*sin((1+2*i)*a) ! y=9*cos((1+1.5*j)*a)
    draw_it(xo,yo,x,y) ! xo=x ! yo=y
    next a ! shadow off ! refresh
  next j ! next i
end

def box(xlu,ylu,width,height,xm,ym,scale)
org_x=xlu+xm*width ! org_y=ylu+(1-ym)*height
xrl=xlu+width ! yrl=ylu+height
refresh off
draw size 4
draw rect xlu-4,ylu-4 to xrl+4,yrl+4
draw size 1 ! draw alpha .2
for x=org_x to xrl step scale ! draw line x,ylu to x,yrl ! next x
for x=org_x to xlu step -scale ! draw line x,ylu to x,yrl ! next x
for y=org_y to yrl step scale ! draw line xlu,y to xrl,y ! next y
for y=org_y to ylu step -scale ! draw line xlu,y to xrl,y ! next y
draw color 0,0,1 ! draw size 2 ! draw alpha 1
draw line xlu,org_y to xrl,org_y
draw line org_x,ylu to org_x,yrl
refresh
end def

def draw_it(xs,ys,xe,ye)
x1=box.org_x+box.scale*xs ! y1=box.org_y-box.scale*ys
x2=box.org_x+box.scale*xe ! y2=box.org_y-box.scale*ye
draw line x1,y1 to x2,y2
end def


User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Some lissajoux figures to play with (iPad only)

Post by Mr. Kibernetik »

:D

Code: Select all

graphics ! graphics clear .8,.8,.8
d=56 ! option angle degrees
fill color 1,1,1
refresh off
loop:
phaseX+=5
phaseY+=10
for i=0 to 2 ! for j=0 to 1
  box(d+j*(300+d),20+i*320,300,300,.5,.5,15)
  draw color 1,0,0 ! draw size 1
  for a=0 to 720 step 2
    x=9*sin((1+2*i)*a+phaseX) ! y=9*cos((1+1.5*j)*a+phaseY)
    if a=0 then ! xo=x ! yo=y ! endif
    draw_it(xo,yo,x,y) ! xo=x ! yo=y
    next a
  next j ! next i
refresh
goto loop

def box(xlu,ylu,width,height,xm,ym,scale)
org_x=xlu+xm*width ! org_y=ylu+(1-ym)*height
xrl=xlu+width ! yrl=ylu+height
draw size 4
draw color 0,0,0
fill rect xlu-4,ylu-4 to xrl+4,yrl+4
draw rect xlu-4,ylu-4 to xrl+4,yrl+4
draw size 1 ! draw alpha .2
step=scale
for x=org_x to xrl step step ! draw line x,ylu to x,yrl ! next x
for x=org_x to xlu step -step ! draw line x,ylu to x,yrl ! next x
for y=org_y to yrl step step ! draw line xlu,y to xrl,y ! next y
for y=org_y to ylu step -step ! draw line xlu,y to xrl,y ! next y
draw color 0,0,1 ! draw size 2 ! draw alpha 1
draw line xlu,org_y to xrl,org_y
draw line org_x,ylu to org_x,yrl
end def

def draw_it(xs,ys,xe,ye)
x1=box.org_x+box.scale*xs ! y1=box.org_y-box.scale*ys
x2=box.org_x+box.scale*xe ! y2=box.org_y-box.scale*ye
draw line x1,y1 to x2,y2
end def
Dropbox link: https://www.dropbox.com/s/ox69j2zyanfbo ... u.txt?dl=0

Henko
Posts: 814
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Re: Some lissajoux figures to play with (iPad only)

Post by Henko »

Nice animation.
You made a powerfull programming language! ;)

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Some lissajoux figures to play with (iPad only)

Post by Mr. Kibernetik »

I hope you will like upcoming "pages" functionality...

User avatar
Фант
Posts: 1363
Joined: Sat Nov 30, 2013 10:01 am
My devices: iPad 4 (iOS 9.3), iMac (MAC OS 11.03)
Location: Россия,Санкт-Петербург
Flag: Russia
Contact:

Re: Some lissajoux figures to play with (iPad only)

Post by Фант »

Отличная работа :!:

Post Reply