Let us substitute the equation of the line in the circle to find out the points of AB.
Hence
y=3−x
Substituting in the equation of the circle gives
x2+(3−x)2−2x+4(3−x)−8=0
x2+(x2−6x+9)−2x+12−4x−8=0
2x2−6x−4x−2x+21−8=0
2x2−12x+13=0
x=12±√144−1044
=12±2√104
=6±√102
Hence
x1=6+√102 and x2=6−√102
Therefore
y1=3−x=−√102 and y2=√102.
Hence,
Let A=(6+√102,−√102) and B=(6−√102,√102)
Hence the centre of the circle with diameter AB is given by
O=(x1+x22,y1+y22)
=⎛⎜
⎜⎝62+622,0⎞⎟
⎟⎠
=(3,0)
The length of diameter AB is
=√(x1−x2)2+(y1−y2)2
=√(√10)2+(√10)2
=√20
=2√5.
Hence the radius is √5.
Thus the required equation of the circle is
(x−3)2+y2=5