intersects
Version:
a simple collection of 2d collision/intersects functions, supporting points, circles, circle outlines (circumference), lines, axis-aligned boxes, and polygons (convex)
16 lines (15 loc) • 505 B
JavaScript
var circlePoint = require('./circle-point')
/**
* circleOutline-point collision
* @param {number} xc center of circle
* @param {number} yc center of circle
* @param {radius} rc radius of circle
* @param {number} x of point
* @param {number} y of point
* @param {number} thickness of circle outline
*/
module.exports = function circleOutlinePoint(xc, yc, rc, x, y, thickness)
{
thickness = thickness || 1
return circlePoint(xc, yc, rc, x, y) && !circlePoint(xc, yc, rc - thickness, x, y)
}