UNPKG

nhz.lib

Version:
14 lines (13 loc) 389 B
module.exports = function(circle, point) { var cr, cx, cy, px, py; if (((circle != null ? circle.length : void 0) === 3) && ((point != null ? point.length : void 0) === 2)) { cx = circle[0], cy = circle[1], cr = circle[2]; px = point[0], py = point[1]; px -= cx; py -= cy; if ((Math.sqrt(px * px + py * py)) <= cr) { return true; } } return false; };