Math and Computation

Geometric Functions

Downloadangle_difference(angle1,angle2)   Returns the difference of the given angles in degress, -180 to 180. Downloadis_clockwise(x1,y1,x2,y2,x3,y3)   Returns true if the given points are in clockwise order. Downloadline_get_slope(x1,y1,x2,y2)   Returns the slope of the given line. Downloadlines_intersect(x1,y1,x2,y2,x3,y3,x4,y4,segment)   Determines if two given lines or line segments intersect. Downloadnormal_detect(x,y,obj [,rad [,res]])   Returns a 2D surface normal for a point on the "surface" of an object. Downloadpoint_in_triangle(x1,y1,x2,y2,x3,y3,x4,y4)   Returns true if the given point is inside the given triangle. Downloadpoint_in_polygon(x,y,polygon)   Returns true of the given point is inside the given polygon. Downloadpoint_in_circle(x,y,cx,cy,r)   Returns true if the test point is within the given circle. Downloadpolygon_area(polygon)   Returns the area of a given polygon. Downloadpolygon_centroid(polygon)   Computes the centroid (center of gravity) of a polygon.