With a perfect square containing one quadrant of a perfect circle, can it be easily determined whether a point is inside the circle?

This is an easy problem if you compute the distance from the corner of the square at the center of the circle (just whether d is less-than-or-equal to r), but is it possible to determine from the point opposite that one without computing the distance from the circle's center.

The context is for image processing. I have the four outer corners of a bounding box but any algorithmic solution becomes complex when you need to compute which part of the bounding box a particular point is. However, I know that every point is inside the bounding box, so I'm wondering if it's possible to measure the distance from all four outer points and determine if a point would lie outside a circle based on its distance from those four corners.

• You don't need the distance to the centre of the circle, you can compute the squared distance, which avoids the expensive square root function call. Mar 23 '21 at 1:00
• Do you know the angle between the dotted line and any one of the four sides of the square?
– YNK
Mar 24 '21 at 9:39

For distances to two adjacent vertices: $$d_1^2=(r-x)^2+(r-y)^2,\qquad d_2^2=(r+x)^2+(r-y)^2$$ so one can find that, $$2(x^2+y^2) = d_1^2 + d_2^2 - \sqrt{(2r+d_1+d_2)(d_1+d_2-2r)(2r+d_1-d_2)(2r+d_2-d_1)}$$
From $$2(x^2+y^2)>2r^2$$, we find the critertion for the point to be out of the cirle: $$d_1^2 + d_2^2 - \sqrt{(2r+d_1+d_2)(d_1+d_2-2r)(2r+d_1-d_2)(2r+d_2-d_1)} > 2r^2$$
Or if you simplify: $$d_1^4+d_2^4 +10r^4 > 6(d_1^2+d_2^2)r^2.$$