Page 1 of 1

How to find places within a given radius

Posted: Sat Feb 06, 2010 4:41 am
by Neo
In an x-y Cartesian coordinate system, the circle with center (h, k) and radius r is the set of all points (x, y) such that,
circle.png
circle.png (869 Bytes) Viewed 3280 times
This is general equation of the circle.

Now, you need to find a given point (x,y) is within the circle or not.

If a point (x,y) is within the circle it must satisfy (x-h)^2 + (y - k)^2 < radius^2

If it is on the circle then should satisfy (x-h)^2 + (y - k)^2 = radius^2

If given (x,y) is within or on the circle, should satisfy (x-h)^2 + (y - k)^2 <= radius^2

If the point is in the exterior of the circle it should satisfy (x-h)^2 + (y - k)^2 > radius^2