(circle-intersects-any? circle all-circles)
(circle-intersects-any? padding circle all-circles)
checks if the given circle intersects with any other given circles
checks if the given circle intersects with any other given circles
(circles-intersect? circle-1 circle-2)
(circles-intersect? padding {c1 :center r1 :radius} {c2 :center r2 :radius})
given two circles and optionallly padding checks if they intersect
given two circles and optionallly padding checks if they intersect
(gen-packed-circles)
(gen-packed-circles config)
(gen-packed-circles config initial-circles)
returns a list of packed circles, where a circle has a :center as 2d vec and :radius. optinally takes a config map containing :min-radius a number or a 0-arity function returning a number :max-radius a number or a 0-arity function returning a number :radius-step a number or a 0-arity function returning a number :max-circles number :max-attempts number :padding a number or a 0-arity function returning a number :random-sampler a 0-arity function that return a 2d vec of random points :in-bounds? a function that takes a circle as argument and return boolean based on bound checks where a circle has a :center as 2d vec and :radius
optionally also takes intial list of circles where a circle has a :center as 2d vec and :radius
default config
{:min-radius 5 :max-radius 10 :max-circles 20 :radius-step 1 :max-attempts 100 :padding 0 :random-sampler #(random-in-rect random-range 0 0 100 100) :in-bounds? (partial in-bound-rect? 0 0 100 100)}
returns a list of packed circles, where a circle has a :center as 2d vec and :radius. optinally takes a config map containing :min-radius a number or a 0-arity function returning a number :max-radius a number or a 0-arity function returning a number :radius-step a number or a 0-arity function returning a number :max-circles number :max-attempts number :padding a number or a 0-arity function returning a number :random-sampler a 0-arity function that return a 2d vec of random points :in-bounds? a function that takes a circle as argument and return boolean based on bound checks where a circle has a :center as 2d vec and :radius optionally also takes intial list of circles where a circle has a :center as 2d vec and :radius --- default config {:min-radius 5 :max-radius 10 :max-circles 20 :radius-step 1 :max-attempts 100 :padding 0 :random-sampler #(random-in-rect random-range 0 0 100 100) :in-bounds? (partial in-bound-rect? 0 0 100 100)}
(in-bound-circle? c1 r1 {c2 :center r2 :radius})
given center as 2d vec, radius and a circle as arguments returns true if the provided circle is in bound where a circle has a :center as 2d vec and :radius. meant to be used for :in-bound?
given center as 2d vec, radius and a circle as arguments returns true if the provided circle is in bound where a circle has a :center as 2d vec and :radius. meant to be used for :in-bound?
(in-bound-rect? x-start y-start x-end y-end {[x y] :center r :radius})
given start and end points of a reactangle and a circle as arguments returns true if the provided circle is in bound where a circle has a :center as 2d vec and :radius. meant to be used for :in-bound?
given start and end points of a reactangle and a circle as arguments returns true if the provided circle is in bound where a circle has a :center as 2d vec and :radius. meant to be used for :in-bound?
(make-circle center radius)
given center as 2d vec and radius generate a circle
given center as 2d vec and radius generate a circle
(random-in-circle random [x y] radius)
given a random number generator, center as 2d vec and radius of a circle returns random points inside
given a random number generator, center as 2d vec and radius of a circle returns random points inside
(random-in-rect random x-start y-start x-end y-end)
given a random number generator (taking min and max arguments), start and end points of a reactangle returns random points inside
given a random number generator (taking min and max arguments), start and end points of a reactangle returns random points inside
(random-range start end)
given start and end generates a random number in range
given start and end generates a random number in range
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close