triangle-circle-collision
Detects if a circle collides with or is fully inside of a triangle.
var collide = var triangle = 350300 450450 350 450var point = 25 15 radius = 15 //returns true if collision occursconsole
You may also be interested in:
Usage
collide(triangle, circle, radius)
Returns true if the circle intersects a triangle edge or if it's fully enclosed by the triangle. Returns false if no collision occurs.
This uses barycentric coordinates to determine if the point is within the circle, and then tests the circle against each edge of the triangle.
License
MIT, see LICENSE.md for details.