Rose

For finished programs
Post Reply
User avatar
kibernetik
Site Admin
Posts: 142
Joined: Tue Aug 06, 2019 3:03 pm

Rose

Post by kibernetik » Mon Sep 30, 2019 8:05 am

This is my version of Rose:

Code: Select all

'Rose
'by Mr.K

draw manual
m = 20
do
  q = 1+rndi m
  s = 1+rndi m
  if q=s or q=oq or s=os then skip

  draw clear 1,1,1
  draw color 1,0,0
  draw size 4
  rose q s

  draw color 1,1,1
  draw size 1
  rose q s

  oq os = q s
  draw update
  delay 0.8
redo

def rose q s
  xc yc = scrcenter|2
  a = 0.9*min xc yc
  if mod(q*s,2)=0 then p = 2 else p = 1
  n = q/s
  draw at xc,yc
  for θ = 0 to pi*s*p step 0.01
    r = a*sin n*θ
    x = xc+r*cos θ
    y = yc-r*sin θ
    draw to x,y
  next
end def
Без названия.jpg
Без названия.jpg (147.88 KiB) Viewed 604 times

Post Reply