Checks if a point is inside or on the boundary of a circle.
The x-coordinate of the point.
The y-coordinate of the point.
The x-coordinate of the circle's center.
The y-coordinate of the circle's center.
The radius of the circle.
True if the point is inside or on the boundary of the circle, false otherwise.
If any parameter is missing or not a number.
// ES Moduleimport { pointInCircle } from '@bnidev/js-utils'// CommonJSconst { pointInCircle } = require('@bnidev/js-utils') Copy
// ES Moduleimport { pointInCircle } from '@bnidev/js-utils'// CommonJSconst { pointInCircle } = require('@bnidev/js-utils')
const isInside = pointInCircle(1, 1, 0, 0, 2) // true, since (1,1) is inside the circle centered at (0,0) with radius 2const isOnBoundary = pointInCircle(2, 0, 0, 0, 2) Copy
const isInside = pointInCircle(1, 1, 0, 0, 2) // true, since (1,1) is inside the circle centered at (0,0) with radius 2const isOnBoundary = pointInCircle(2, 0, 0, 0, 2)
Checks if a point is inside or on the boundary of a circle.