distance.

This commit is contained in:
2014-10-06 20:43:33 -07:00
parent d724080220
commit 2b7b663e72
5 changed files with 35 additions and 15 deletions

View File

@@ -44,6 +44,12 @@
range (+ (* percent-complete (- maximum-size minimum-size)) minimum-size)]
range)))))
(defn dist [x1 y1 x2 y2]
(let [dx (- x1 x2)
dy (- y1 y2)]
(Math/sqrt (+ (* dx dx) (* dy dy)))))
(defn flip [anim]
(animation (animation! anim :get-frame-duration)
(for [src-frame (animation! anim :get-key-frames)