(x-a)^2
+(y-b)^2=
r^2
Where (a, b) is the center coordinate and r is the radius.
So once the center of the circle is determined, that is, A and B, you can write the equation directly.