Find the equation of a circle passing through (3,7) and tangent to the line x-3y+8=0

The the centre be C(a,b)

and the point of contact with the line P(x,y)
let A(3,7) be the given point on the circle

AP must be a diameter, and at right angles to the given line
slope of given line = 1/3
so slope of diameter = -3
but (3,7) lies on it, so the equation is
y = -3x + b
7 = -3(3) + b
b = 16
diameter has equation y = -3x + 16

solving the two equations would give us P
x - 3(-3x+16) + 8 = 0
x + 9x - 48 + 8 = 0
10x = 40
x = 4
then y = -3(4) + 16 = 4
P is the point (4,4)
so the centre must be the midpoint and
C = (7/2, 11/2)

circle equation:
(x-7/2)^2 + (y-11/2)^2 = r^2
r = 1/2 the diameter
diameter = √( (-1)^2 + 3^2 ) = √10
r = √10/2
r^2 = 10/4 = 5/2

circle equation:
(x-7/2)^2 + (y-11/2)^2 = 5/2

To find the equation of a circle passing through a given point and tangent to a given line, we can follow these steps:

Step 1: Find the center of the circle.
Step 2: Find the radius of the circle.
Step 3: Use the center and radius to write the equation of the circle.

Let's go through each step:

Step 1: Find the center of the circle.
Since the circle passes through the point (3,7), the center of the circle is (h, k), and we know that (x - h)^2 + (y - k)^2 = r^2 represents the equation of a circle. Substituting the given point coordinates, we get:
(3 - h)^2 + (7 - k)^2 = r^2

Step 2: Find the radius of the circle.
The circle is tangent to the line x-3y+8=0. This means that the distance between the center of the circle and the line is equal to the radius of the circle. We can use the formula to find this distance:
Distance = |Ax + By + C| / √(A^2 + B^2)

Given line equation: x - 3y + 8 = 0
By comparing this equation with Ax + By + C = 0, we find A = 1, B = -3, and C = 8.

The distance between the center of the circle (h, k) and the line x - 3y + 8 = 0 is:
Distance = |1h - 3k + 8| / √(1^2 + (-3)^2)
Distance = |h - 3k + 8| / √(10)

Since the circle is tangent to the line, the distance is equal to the radius of the circle. So we have:
|r| = |h - 3k + 8| / √(10)

Step 3: Use the center and radius to write the equation of the circle.
Now we can write the equation of the circle using the center (h, k) and the radius r:
(x - h)^2 + (y - k)^2 = r^2

Substituting the radius in terms of the center coordinates, we have:
(x - h)^2 + (y - k)^2 = (|h - 3k + 8| / √(10))^2

Therefore, the equation of the circle passing through (3,7) and tangent to the line x-3y+8=0 is:
(x - h)^2 + (y - k)^2 = (|h - 3k + 8| / √(10))^2