Created
July 20, 2009 14:25
-
-
Save oranenj/150361 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
(defn get-bounds [objects | |
coordinate-func] | |
"Returns a seq of the min and max coordinates" | |
(let [[start & coords] (map coordinate-func objects)] | |
(reduce (fn [[min-acc max-acc] coord] | |
[(map min min-acc coord) | |
(map max max-acc coord)]) | |
[start start] coords))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment