Created
July 14, 2020 00:49
-
-
Save nariakiiwatani/6b1d906106479eae621c3ce9f945a42c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(defn clamp | |
{:inverse (fn [{:return ret :params [v min max]}] | |
[ret min max])} | |
[v min max] | |
(if (< v min) min | |
(if (> v max) max | |
v)) | |
) | |
(defvar v 142.8125) | |
(style (stroke "salmon" 5) | |
(circle [(clamp v -100 100) (clamp v -50 50)] 50) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment