Geometry functionality for 2D operations.
Geometry functionality for 2D operations.
(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
(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
(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
(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
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close