JavaScript: Check whether a point lies strictly inside a given circle
JavaScript Basic: Exercise-120 with Solution
Check if Point is Inside Circle
Write a JavaScript program to check if a point lies strictly inside the circle.
Input:
Center of the circle (x, y)
Radius of circle: r
Point inside a circle (a, b)
Sample Solution:
JavaScript Code:
Output:
true false
Live Demo:
Flowchart:

ES6 Version:
For more Practice: Solve these Related Problems:
- Write a JavaScript program that determines if a given point lies strictly inside a circle using the distance formula.
- Write a JavaScript function that calculates the distance between a point and a circle’s center and checks it against the radius.
- Write a JavaScript program that validates input coordinates and returns true if the point is inside the circle, false otherwise.
Go to:
PREV : Check if Digits in Integer Are Increasing.
NEXT : Check if Matrix is Lower Triangular.
Improve this sample solution and post your code through Disqus.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.