Skip to content

Instantly share code, notes, and snippets.

@the-vishal-kumar
Created October 3, 2021 15:22
Show Gist options
  • Save the-vishal-kumar/94bc545a20962ca32dd39c2d1fb85ecd to your computer and use it in GitHub Desktop.
Save the-vishal-kumar/94bc545a20962ca32dd39c2d1fb85ecd to your computer and use it in GitHub Desktop.
Program to determine whether a point is inside or outside a circle
const isPointInsideCircle = (centre, radius, point) => {
return (Math.pow(point.x - centre.x, 2) + Math.pow(point.y - centre.y, 2)) <= (Math.pow(radius, 2));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment