Proof of Intersection of A Line and A Circle: Coincident
Proof of Intersection of A Line and A Circle: Coincident
P2 (x2 , y2 )
P1 (x1 , y1 ) r
C(xc , yc )
(x − xc )2 + (y − yc )2 − r2 = 0
x = x0 + f t
y = y0 + gt
Substituting for (parametric line) x and y into the circle equation gives a quadratic equation in t:
• Two roots of which give points on the line where cuts the circle.
1 r
C(xc , yc )
1
Proof:
(x − xc )2 + (y − yc )2 − r2 = 0 (1)
x = x0 + f t
y = y0 + gt (2)
Substituting for (parametric line) x and y from Eqn. 2 into the circle equation, Eqn. 1, gives a
quadratic equation in t gives:
Let
xd = x0 − xc
yd = y0 − yc (4)
2
Now the general solution of a quadratic of the form ax2 + bx + c = 0, gives the roots, xi , i = 1, 2 as:
√
−b ± b2 − 4ac
xi = (8)
2a
So in our problem (a quadratic in t) from Eqn. 7 we can see that for Eqn. 8:
a = (f 2 + g 2 )
b = 2(f xd + gyd )
c = x2d + yd2 − r2
q
−2(f xd + gyd ) ± (2(f xd + gyd ))2 − 4(x2d + yd2 − r2 )(f 2 + g 2 )
ti =
2(f 2 + g 2 )
q
−2(xd + gyd ) ± 4(f xd + gyd )2 − 4(x2d + yd2 − r2 )(f 2 + g 2 )
ti =
2(f 2 + g 2 )
(9)
The expression of the right hand side of Eqn. 9 can be simplified in a few ways.
√
Firstly we can factor 4 from the term and the division by 2 then simplifies the equation to:
q
−2(xd + gyd ) ± 2 (f xd + gyd )2 − (x2d + yd2 − r2 )(f 2 + g 2 )
ti =
2(f 2 + g 2 )
q
−(f xd + gyd ) ± (f xd + gyd )2 − (x2d + yd2 − r2 )(f 2 + g 2 )
ti =
(f 2 + g 2 )
(10)
3
√
Let us now consider the term and simplify this, let:
Eqn 11 can be simplified as follows, some terms cancel out f 2 x2d , g 2 yd2 and others can be gathered
together r2 , f, and g terms:
√
Substituting for S from Eqn. 13 and xd and yd from Eqn. 4 in the term in Eqn. 10 gives us the
solution:
Q.E.D