equation of a circle: (x - a)^2 + (y - b)^2 = r^2, where the circle has centre (a, b) and radius r.
Let's draw the diagram, where (x, y) is some point on the circle, which for ease we'll call P, and (a, b) is the centre of the circle, which we'll call O, and r is its radius. Let us construct a line from O to P; notice this length is the radius, or r, since it is a line from the centre to the circumference of the circle. The horizontal distance between O and P is |x - a| (the value (x - a) will be negative if we chose the point P to be to the left of O, so we take the absolute value of it to make sure we get the positive horizontal distance.) Similarly, the vertical distance between O and P is |y - b|. We have constructed a right-angled triangle with sides |x - a|, |y - b| and hypotenuse r. By Pythagoras' Theorem, (|x - a|)^2 + (|y - b|)^2 = r^2But notice that no matter whether we square a positive or negative number, we get a positive number. For example, (-5)^2 = 5^2 = 25, so we can remove the absolute value signs to obtain the circle equation:
(x - a)^2 + (y - b)^2 = r^2.