Skip to content

Instantly share code, notes, and snippets.

@nariakiiwatani
Created July 14, 2020 00:49
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 nariakiiwatani/6b1d906106479eae621c3ce9f945a42c to your computer and use it in GitHub Desktop.
Save nariakiiwatani/6b1d906106479eae621c3ce9f945a42c to your computer and use it in GitHub Desktop.
(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