Created
August 27, 2020 07:54
-
-
Save cieloazul310/7bfd07f14531814ffd87a774bbae3e96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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