Skip to content

Instantly share code, notes, and snippets.

@postspectacular
Created June 26, 2016 12:14
Show Gist options
  • Save postspectacular/14aa9f6e5bd1c56965cc3509a27ff933 to your computer and use it in GitHub Desktop.
Save postspectacular/14aa9f6e5bd1c56965cc3509a27ff933 to your computer and use it in GitHub Desktop.
Polygon generation and resampling
(require '[thi.ng.geom.core :as g])
(require '[thi.ng.geom.circle :as c])
(require '[thi.ng.geom.polygon :as poly])
(-> (c/circle 100)
(g/as-polygon 6)
(g/sample-uniform 10 false))
;; [[100.0 0.0] [95.0 8.660254037844387] [90.0 17.320508075688775] ...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment