Skip to content

Instantly share code, notes, and snippets.

@oranenj
Created July 20, 2009 14:25
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 oranenj/150361 to your computer and use it in GitHub Desktop.
Save oranenj/150361 to your computer and use it in GitHub Desktop.
(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