Liking cljdoc? Tell your friends :D

infinitelives.utils.geom2

Geometry functionality for 2D operations.

Geometry functionality for 2D operations.
raw docstring

anglecljs

(angle p1 p2 p3)

given three points in R2 space (represented as vec2's p1, p2 and p3) calculate the inner angle formed around p2 by the vectors p2->p1 and p2->p3

given three points in R2 space (represented as vec2's p1, p2 and
p3) calculate the inner angle formed around p2 by the vectors p2->p1
and p2->p3
sourceraw docstring

negative-poly?cljs

source

outside-anglecljs

(outside-angle a b c)

given three vec2 points representing an angle, calculate the 'outside' angle formed on the central point, b. By outside we mean 'in the positive polar direction'. That is, on a computer display co-ordinate system, in a clockwise direction (from vector a->b) and in a maths co-ordinate system, a counter-clockwise direction. If the angle is in the negative polar direction, returns a negative value

given three vec2 points representing an angle, calculate the
'outside' angle formed on the central point, b. By outside we mean
'in the positive polar direction'. That is, on a computer display
co-ordinate system, in a clockwise direction (from vector a->b) and
in a maths co-ordinate system, a counter-clockwise direction. If the
angle is in the negative polar direction, returns a negative
value
sourceraw docstring

point-in-triangle?cljs

(point-in-triangle? [v1 v2 v3] point)
source

polygon-tripletscljs

(polygon-triplets poly)

take the vec2 points of a polygon, and return triplets of consecutive points representing each angle in turn. So for a polygon [a b c d e] return [ [e a b] [a b c] [b c d] [c d e] [d e a]], That is, the corner a, then the corner b ... and so on

take the vec2 points of a polygon, and return triplets of
consecutive points representing each angle in turn. So for a
polygon [a b c d e] return [ [e a b] [a b c] [b c d] [c d e] [d e
a]], That is, the corner a, then the corner b ... and so on
sourceraw docstring

positive-poly?cljs

source

total-outside-anglecljs

(total-outside-angle poly)

Sum all the outside angles on a polygon. Should return 2pi or -2pi

Sum all the outside angles on a polygon. Should return 2*pi or
-2*pi
sourceraw docstring

triangulatecljs

(triangulate poly)
(triangulate poly tris)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close