Could someone please explain the theory behind finding if a given point is inside a circle on a grid? Let us say I have a grid of 1000 x 1000, and on that grid is drawn a circle, the circle could be anywhere.
If I then pick a random point from the grid with an x and y co-ordinate I can work out if the point is inside the circle by performing the following math,
xCoord = x co-ordinate;
yCoord = y co-ordinate;
xCenter = x co-ordinate of the center of the circle
yCenter = y co-ordinate of the center of the circle
radius = the circle's radius

((xCoord - xCenter) ^ 2 + (yCoord - yCenter) ^ 2) < (radius ^ 2)

If the radius ^ 2 is less than ((xCoord - xCenter) ^ 2 + (yCoord - yCenter) ^ 2) then it means that the co-ordinates were inside the circle.
I am struggling alot to wrap my head around this and cannot seem to work out how it works out that the co-ordinates were inside the circle.
Could someone please break this down for me and explain how it is worked out (what is going on in a logical manner so to speak)?
Sorry if my question is formatted wrong it is my first question on this site.
Thanks

Let me try to answer in words only. you have a circle. To fill it in, as with a paint program, it's every point whose distance from the center of the circle is less than the radius of the circle. Simple enough.
To test if a point is inside the circle, calculate the distance from the center point to your point. If less than the radius, it's in your circle. 
