Circle Tangent Intersect Proof

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Proof of an implicit line equation through a point (not on the circle)

that is tangent to a general circle

Derivation of an equation that calculates the the general equation of an implicit line through a
point (not on the circle) that is tangent to a general circle:

P (x, y)

r
C(xc , yc )
J(xj , yj )

We wish to find the implicit equation of the tangent

ax + by + c = 0

The coefficients a and b are obtained from:

∓r(xc − xj ) − (yc − yj ) (xc − xj )2 + (yc − yj )2 − r2


p
a=
(xc − xj )2 + (yc − yj )2
∓r(yc − yj ) + (xc − xj ) 1(xc − xj )2 + (yc − yj )2 − r2
p
b= (1)
(xc − xj )2 + (yc − yj )2

c then obtained from the fact that the tangent passes through J:
c = −axj − byj

See http://www.netsoc.tcd.ie/∼jgilbert/maths site/applets/circles/tangents to circles.html for a java


applet demo.

Proof:

1
P (x, y)

θ r
C(xc , yc )
J(xj , yj )

We know the coordinates of the circle (xc , yc ) and its radius, r.

We also know the coordinates of the general point, J(xj , yj ).

We can therefore form a vector t between C and J, t = (xt , yt ) where xt = xc − xj and yt = yc − yj


(This is essentially using variable substitution to ease the following algebra)

We can also define a vector n which is from the centre C to the point of intersection P (x, y) of the
tangent with the circle.

By definition this vector n is perpendicular the the tangent as all tangents to a circle are per-
pendicular to a line from the center. 1

n therefore gives the parameters for the a and b coefficients of the implicit line equation of the
tangent. So we may write n = (a, b).

Let us assume that n is a normal vector then knk = 1 and

a2 + b2 = 1 (2)

Define the angle between n and t as θ.

Using the Cauchy-Schwarz inequality we may write the angle between

n.t
cos θ =
knkktk
axt + byt
= (3)
ktk

Now there also exist a right-hand triangle formed by points C,P and J. (Right angle at P ).

So we may write (by simple trigonometry):

2
r
cos θ = (4)
ktk

So equating cos θ in Eqns. 3 and 4 we get:

axt + byt r
=
ktk ktk
axt + byt = r (5)

From Eqn. 2 we may write a as:

p
a= 1 − b2 (6)

Substituting for a from Eqn. 6 in Eqn. 5, we get:

p
1 − b2 (xt ) + byt = r
p
1 − b2 (xt ) = r − byt
(7)

Squaring both sides of the equation we get:


(1 − b2 )x2t = r2 − 2ryt b + yt2 b2
x2t − x2t b2 = r2 − 2ryt b + yt2 b2
r2 − 2rbyt + yt2 b2 − x2t + x2t b2 = 0
(x2t + yt2 )b2 − 2ryt b + r2 − x2t = 0
(8)

Now Eqn. 8 is a quadratic in b which may be solved as:

2ryt ± 4r2 yt 2 − 4(x2t + yt2 )(r2 − x2t )


p
b =
2(x2t + yt2 )
ryt ± r2 yt 2 − (x2t + yt2 )(r2 − x2t )
p
=
(x2t + yt2 )
(9)

3
Let us now simplify the square root part of Eqn. eqn:bsol:

r2 yt 2 − (x2t + yt2 )(r2 − x2t ) = r2 yt 2 − (x2t r2 − x4t + r2 yt2 − yt2 x2t )


)
= r2 yt 2 − x2t r2 + x4t − r2 yt2 + yt2 xt
= −x2t r2 + x4t + yt2 x2t
= x2t (x2t + yt2 − r2 )
(10)

So putting this back in Eqn. 9 we get

x2t (x2t + yt2 − r2 )


p
ryt ±
b =
x2 + yt2
pt
ryt ± xt x2t + yt2 − r2
= (11)
x2t + yt2

If we now substitute for xt = xc − xj and yt = yc − yj we get the required solution for b in Eqn. 1.

Well some rearranging of the ± sign (since as we are using vectors we can have only need to preserve
the respective signs of the vector we can rearrange to get the formula as given in Programmer’s
Geometry Text Book (Page 29):

∓r(yc − yj ) + (xc − xj ) (xc − xj )2 + (yc − yj )2 − r2


p
b=
(xc − xj )2 + (yc − yj )2

If we now take b from Eqn. 11 and substituting d = x2t + yt2 − r2 and j = x2t + yt2 we may write
p

b as

ryt ± xt d
b= (12)
j

substitute for b in Eqn. 5

ryt ± xt d
axt + ( )yt = r
j
ryt ∓ xt d
axt + = r − ( )yt
j
rj − ryt2 ∓ xt yt d
axt + =
j

4
rj − ryt2 ∓ xt yt d
a=
jxt
(13)

Substitue for j in top line (and then divide out the xt and then sub for xt , yt , dand j (bottom line):

rxt2 + ryt2 − ryt2 ∓ xt yt d


a=
jxt
rxt ∓ yt d
a=
j
rxt ∓ yt xt + yt − r2
p
2 2
a= (14)
x2t + yt2

We now have the required solution for a in Eqn 1.

Well some rearranging of the ± sign (since as we are using vectors we can have only need to preserve
the respective signs of the vector we can rearrange to get the formula as given in Programmer’s
Geometry Text Book (Page 29):

∓r(xc − xj ) − (yc − yj ) (xc − xj )2 + (yc − yj )2 − r2


p
a=
(xc − xj )2 + (yc − yj )2

c then obtained from the fact that the tangent passes through J:

c = −axj − byj

Q.E.D.

You might also like