@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
17 lines (14 loc) • 459 B
JavaScript
import { v2_distance } from "../../vec2/v2_distance.js";
/**
*
* @param {number} cx Center of the circle
* @param {number} cy Center of the circle
* @param {number} cr Radius of the circle
* @param {number} px Point coordinate X
* @param {number} py Point coordinate Y
* @returns {boolean}
*/
export function circle_intersects_point(cx, cy, cr, px, py) {
const distance = v2_distance(cx, cx, px, py);
return distance < cr;
}