Moire Flower Clock
#1
Moire Happy Times!

Code:
' Moire Flower Clock.bas SmallBASIC 0.12.9 (B+=MGA) 2017-05-19
' The Moire Flower Series Meets Analog clock 2017-04-27 [B+=MGA]
' Public Domain
randomize timer
const x0 = xmax/2
const y0 = ymax/2
const cr = y0/2
d = 1 : n = 12
while 1
 cls
 for i = 1 to n
   cx = x0 + ymax/4*cos(i*2*pi/n-pi/2)
   cy = y0 + ymax/4*sin(i*2*pi/n-pi/2)
   cx2 = x0 + (ymax/4-r)*cos(i*2*pi/n-pi/2)
   cy2 = y0 + (ymax/4-r)*sin(i*2*pi/n-pi/2)
   for a = 0 to ymax/4 step 10
     circle cx, cy, a color rgb(225, 100, 100)
     circle cx2,cy2, a color rgb(128, 0, 40)
   next
 next
 timehms timer, hour, mint, ssec
 hours = hour+(mint/60)
 if ( hours > 12 ) then hours -= 12
 ha  = hours *(2*PI)/12 : drawHand ha, cr * 0.5
 ma  = mint  *(2*PI)/60 : drawHand ma, cr * 0.75
 sa  = ssec  *(2*PI)/60 : drawHand sa, cr
 circle x0, y0, 2, 1, 0
 showpage
 delay 40
 r += d
 if r > ymax/4 then r = ymax/5 : d *= -1
 if r < 0   then r = 0   : d *= -1
wend

sub drawHand(a, r)
 dim h()
 rr = 1/r * 900
 h << x0 + r    * cos(a-pi/2) : h << y0 + r    * sin(a-pi/2)
 h << x0 + rr   * cos(a)      : h << y0 + rr   * sin(a)
 h << x0 + 3*rr * cos(a+pi/2) : h << y0 + 3*rr * sin(a+pi/2)
 h << x0 + rr   * cos(a+pi)   : h << y0 + rr   * sin(a+pi)
 h << x0 + r    * cos(a-pi/2) : h << y0 + r    * sin(a-pi/2)
 color 15 : drawpoly h filled : color 0  : drawpoly h
end


Attached Files Thumbnail(s)

B += x
Reply
#2
thats a great idea. do they move? im pretty sure you could make them move. have an option at the top: anim = 1
Reply
#3
Yes, they move for your a moire the moire. ;-))

I pretty much make everything move and screen shots never do justice to my efforts.

What I like best with graphics is the movies (and the plasma). ;D
B += x
Reply
#4
Dang, it's been awhile since I ran this code, I am impressed with myself! ;D

But where is my Pi Calculation program I was doing around this time of year?
Ha! I guess I never posted it.
B += x
Reply