Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cieloazul310/7bfd07f14531814ffd87a774bbae3e96 to your computer and use it in GitHub Desktop.
Save cieloazul310/7bfd07f14531814ffd87a774bbae3e96 to your computer and use it in GitHub Desktop.
(defvar size 200)
(deftime time 1)
(defn transition [from to]
(/ (max 0 (- (min time to) from)) (- to from))
)
(defn transitionVec [p q from to]
(vec2/+ p (vec2/* (vec2/- q p) [(transition from to) (transition from to)]))
)
(style (fill "white")
(rect [0 0 size size])
)
(style (fill "black")
(rect [0 0 (* size (transition 0.25 0.5)) (* size (transition 0.25 0.5))])
)
(style (fill "white")
(rect [0 0 (* size (transition 0.75 1)) 20])
(rect [0 40 (* size (transition 0.8 1.05)) 20])
(rect [0 80 (* size (transition 0.85 1.1)) 20])
(rect [0 120 (* size (transition 0.9 1.15)) 20])
(rect [0 160 (* size (transition 0.95 1.2)) 20])
)
(style (fill "white")
(circle [(/ size 2) (/ size 2)] (* (* (/ size 2) (sqrt 2)) (transition 1.5 1.75)))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment