Tangent Line to a Circle: Equation, Method, and Solved Examples

Finding the equation of a line tangent to a circle is one of the most common — and most important — problems in analytic geometry, and it represents a fundamental step in the study of the relationship between lines and curves. Many exercises ask for the equation of a line tangent to a circle, either when the point of tangency is already known, or when the tangent must be drawn from a point outside the circle.

This article shows how to calculate the tangent lines to a circle in a clear, systematic way, using two distinct methods: a more immediate one, based on the distance from a point to a line (or from the center to a line), and a fully analytical method (more general), based on the tangency condition expressed through the discriminant. The discussion closes with fully worked examples and with the special case in which the point of tangency is not external to the circle, but lies on it.

The goal is to provide a complete, operational guide, useful for both theoretical study and problem solving.

This article covers HOW TO FIND THE TANGENT LINE TO A CIRCLE, specifically:

  • How to apply the condition \(d=r\) to find the slopes of the tangent lines (Method 1: distance from a point to a line)
  • How to use the condition \(\Delta=0\) on the line-circle system (Method 2: analytical)
  • How to write the equation of the tangent line when the point lies on the circle
  • Which mistakes to avoid in the calculations and how to choose the most efficient method
  • How to solve the exercises step by step

What is a tangent line to a circle

Definition and geometric meaning

A line tangent to a circle is a line that has exactly one point in common with the circle, called the point of tangency.

From a geometric standpoint, the tangent line has a fundamental property: it is perpendicular to the radius of the circle drawn to the point of tangency. In other words, if \(C(h,k)\) is the center of the circle and \(A\) and \(B\) are the points of tangency (as in Fig. 1), then the tangent lines at \(A\) and at \(B\) are respectively perpendicular to the segments \(CA\) and \(CB\).

Tangents to the circle from an external point
Fig. 1 – Tangent lines to a circle drawn from a generic external point \(P\). Points \(A\) and \(B\) are the points of tangency.

This property underlies one of the most widely used methods for finding the equation of a tangent line, and it will be used later on. In analytic terms, however, the tangency condition can also be expressed algebraically: a line is tangent to a circle if the system formed by their equations has exactly one real solution.

This dual interpretation, geometric and analytical, makes it possible to approach the problem from different angles, each with its own advantages.

A broader overview of the circle — standard form, general form, and every related topic — is available in the circle in coordinate geometry guide.

Equation of the circle and data needed to find the tangent line

Consider the equation of a circle written in the form:

\[(x-h)^2+(y-k)^2=r^2\tag{1}\]

where:

  • \(C(h,k)\) is the center of the circle
  • \(r\) is the radius

To find the equations of the lines tangent to the circle and passing through an external point \(P(x_0, y_0)\), the following must be known:

  1. The coordinates of the center \(C\)
  2. The radius \(r\)
  3. The coordinates of the external point \(P\)

Tangent lines drawn from a point external to the circle: setting up the problem

Let \(P(x_0, y_0)\) be a point external to the circle. From \(P\), two tangent lines can be drawn. The problem consists in finding the equations of these two lines.

To solve it, two distinct methods will be used:

  • Method 1: based on the distance from a point to a line (here, the point is the center of the circle), more straightforward for students
  • Method 2: an analytical approach (using the discriminant), rigorous and of general validity for every conic

Method 1 – Finding the tangent lines to a circle through the distance from a point to a line

Equation of the line and tangency condition

Consider a generic line through \(P(x_0, y_0)\) with variable slope \(m\):

\[y-y_0=m(x-x_0)\tag{2}\]

As known from the theory, the distance \(d\) from the center \(C(h,k)\) to the generic line of equation (2), which passes through \(P\), is given by:

\[d = \frac{|a h + b k + c|}{\sqrt{a^2 + b^2}}\tag{3}\]

where \(a\), \(b\), and \(c\) are the coefficients of the line:

\[ax+by+c=0\tag{4}\]

obtained by rewriting (2) in general form.

For the line to be tangent to the circle, the following must hold:

\[d=r \quad \text{(tangency condition)}\tag{5}\]

and, therefore, using equation (3), since the radius \(r\) of the circle is known:

\[\frac{|a h + b k + c|}{\sqrt{a^2 + b^2}}=r \quad \text{(tangency condition)} \tag{6}\]

Finding the tangent lines

Solving equation (6) with respect to \(m\), gives the two slopes \(m\) of the tangent lines to the circle. Substituting these values of \(m\) into (2) then gives the two final equations of the tangent lines.

Worked examples (with the distance from a point to a line method)

Example 1

Given the circle of equation

\[x^2 + y^2 = 25\]

and a point \(P\) external to it with coordinates \(P=(7,0)\), find the equations of the lines tangent to the circle.

STEP-BY-STEP SOLUTION

Write the equation of the line through \(P\) with generic slope \(m\), using the point-slope equation (2) (see also family of concurrent lines):

\[y-y_0=m(x-x_0)\]

Substituting the coordinates of \(P(7,0)\) gives:

\[y-0=m(x-7) \implies y=m(x-7)\]

The distance-from-a-point-to-a-line formula requires form (4):

\[ax+by+c=0\]

so the coefficients \(a,b,c\) must be found.

Starting from \(y=m(x-7)\), it follows that:

\[y=mx-7m \implies mx-y-7m=0\]

hence:

\[a=m, \quad b=-1, \quad c=-7m\]

The distance of the center \(C(0,0)\) from the line is given by (3):

\[d = \frac{|a h + b k + c|}{\sqrt{a^2 + b^2}}\]

Substituting the values:

\[d = \frac{|m\cdot 0-1\cdot 0-7m|}{\sqrt{(m)^2 + (-1)^2}}=\frac{|-7m|}{\sqrt{m^2 + 1}}\]

For the line to be tangent to the circle, condition (5) must hold:

\[d=r=5\]

This gives:

\[\frac{|-7m|}{\sqrt{1 + m^2}} = 5\]

Multiplying both sides by \(\sqrt{1 + m^2}\):

\[|-7m| = 5\sqrt{1 + m^2}\]

Squaring both sides removes the absolute value and the square root:

\[(-7m)^2 = 25(1 + m^2)\] \[49m^2 = 25 + 25m^2\] \[49m^2-25m^2 = 25\] \[24m^2=25\] \[m^2 = \frac{25}{24} \implies m_{1,2} = \pm\frac{5}{\sqrt{24}} = \pm\frac{5}{2\sqrt{6}} = \pm\frac{5\sqrt{6}}{12}\]

Substituting each of the two slopes \(m_{1,2}\) into (2) gives the final equations of the tangent lines:

\[y = \frac{5\sqrt{6}}{12}(x-7)\] \[y = -\frac{5\sqrt{6}}{12}(x-7)\]

Notes:

  • Each line touches the circle at exactly one point, as expected.
  • The opposite slopes correspond to symmetry with respect to the horizontal axis (see Fig. 2).
Tangent lines to a circle_center-line distance method
Fig. 2 – Lines tangent to the circle of equation \(x^2+y^2=25\), passing through the point \(P(7,0)\).
\(A\) and \(B\) are the points of tangency.

Example 2

Given the circle of equation

\[x^2+y^2-4x-2y-5=0\]

and the point of coordinates \(P(7,6)\), find the equations of the lines tangent to the circle and passing through \(P\).

STEP-BY-STEP SOLUTION

Solve the problem by applying the first method again (distance from the center to the line).

Note first that the equation of the line with generic slope \(m\) passing through \(P\) is again obtained (as in the previous example) from the point-slope form (2) by substituting the coordinates of point \(P\):

\[y-6=m(x-7)\]

which can be rearranged as

\[mx-y-7m+6=0\]

from which the coefficients of the line follow:

\[a=m \quad b=-1 \quad c=-7m+6\]

Before imposing the condition \(d=r\), the radius \(r\) of the circle must first be found.

Notice that the equation of the circle is written in general form, so its radius is calculated as:

\[r=\sqrt{\frac{D^2+E^2}{4}-F}\]

where, in this case,

\[D=-4\quad E=-2\quad F=-5\]

are the coefficients of the circle in general form.

⚠️ Note

Before continuing, it is worth reviewing how to find the center and radius of a circle starting from its general form. If the concept is already clear, continue with the next section.

The center \(C\) has coordinates

\[C=\left(-\frac{D}{2},-\frac{E}{2}\right)=(2,1)\]

Substituting the numerical values into the radius formula gives

\[r=\sqrt{\frac{(-4)^2+(-2)^2}{4}-(-5)}=\sqrt{10}\]

At this point, the tangency condition (5) can be imposed in geometric terms: the radius \(r\) of the circle must equal the distance between the center and the tangent line, so:

\[\frac{|a h + b k + c|}{\sqrt{a^2 + b^2}}=r\]

Substituting the numerical values after imposing condition (5) gives:

\[\frac{|m\cdot 2-1\cdot 1-7m+6|}{\sqrt{m^2 + (-1)^2}}=\sqrt{10}\]

Multiplying both sides by \(\sqrt{m^2 + (-1)^2}\) and then squaring gives

\[(-5m+5)^2=10(m^2+1)\]

Simplifying further by expanding the square on the left side and rearranging:

\[25m^2+25-50m=10m^2+10\] \[15m^2-50m+15=0\] \[3m^2-10m+3=0\]

Compute the discriminant \(\Delta\) of the last equation:

\[\Delta=(-10)^2-4(3)(3)=64\]

Finally, compute the values of \(m\):

\[m_{1,2}=\frac{10\pm\sqrt{64}}{2\cdot 3}=\frac{10\pm8}{6}\]

so

\[m_1=\frac{18}{6}=3\] \[m_2=\frac{2}{6}=\frac{1}{3}\]

To write the equations of the tangent lines, substitute each value of \(m\) found into the original equation of the line through \(P\), obtaining:

\[y-6=3(x-7)\] \[y-6=\frac{1}{3}(x-7)\]

Tangent lines to a circle_center-line distance method-example2
Fig. 3 – Lines tangent to the circle of equation \(x^2+y^2-4x-2y-5=0\), passing through the point \(P(7,6)\).
\(A\) and \(B\) are the points of tangency.

Method 2 – Finding the tangent lines to a circle: the analytical condition (discriminant equal to zero)

Setting up the analytical problem

Consider the circle of equation

\[(x-h)^2+(y-k)^2=r^2\]

and the generic line of equation

\[y=mx+b\]

passing through a point \(P(x_0, y_0)\) external to the circle.

Substituting the equation of the line into the equation of the circle gives a quadratic equation in \(x\):

\[(x-h)^2+(mx+b-k)^2=r^2\tag{7}\]

Imposing the tangency condition

The tangency condition requires that the discriminant of the quadratic equation (7) be equal to zero:

\[\Delta=0\tag{8}\]

Finally, solving (8) with respect to \(m\) gives the equations of the tangent lines.

Worked examples (with the analytical method)

Example 1

Find the equations of the lines tangent to the circle centered at the origin with unit radius, passing through the point of coordinates \(P(0,2)\).

STEP-BY-STEP SOLUTION

Write the equation of the circle centered at the origin with radius 1:

\[x^2+y^2=1\]

Noting that here \(P\) is the \(y\)-intercept of the generic line of slope \(m\), the equation of the line can be written as:

\[y=mx+2\]

To find the equations of the tangent lines, solve the system formed by the two equations while imposing \(\Delta=0\):

\[\left\{\begin{matrix} x^2+y^2=1 \\y=mx+2 \end{matrix}\right.\]

Substituting the second equation into the first gives:

\[x^2+(mx+2)^2=1\] \[x^2+m^2x^2+4+4mx-1=0\]

so, collecting and rearranging in \(x\):

\[(1+m^2)x^2+4mx+3=0\]

Now impose the tangency condition (\(\Delta=0\)) on this resolving equation to find the values of \(m\).

This gives:

\[(4m)^2-4(1+m^2)(3)=0\]

Now work through the calculations step by step to find the values of \(m\):

\[16m^2-12m^2-12=0\] \[4m^2-12=0\] dividing by 4 \[m^2-3=0\] \[m^2=3 \implies m_{1,2}=\pm\sqrt{3}\]

Substituting these slopes into the equation of the line gives the following tangent lines to the circle:

\[y=\sqrt{3}x+2\] \[y=-\sqrt{3}x+2\]

Tangent to the circle - Exercise 1_analytical method
Fig. 4 – Lines tangent to a circle of unit radius centered at the origin, passing through a point on the \(y\)-axis, \(P(0,2)\).

Example 2

Find the equations of the lines tangent to the circle of center \(C(-4,-3)\) and radius \(r=2\), passing through the point \(P(1,2)\).

STEP-BY-STEP SOLUTION

Recalling that the circle of center \(C(h,k)\) is written as:

\[(x-h)^2+(y-k)^2=r^2\] substituting the data gives \[(x+4)^2+(y+3)^2=4\]

The equation of the line, in turn, follows from the usual formula:

\[y-y_0=m(x-x_0)\]

where \(x_0\) and \(y_0\) are the coordinates of \(P\), so substituting gives:

\[y-2=m(x-1)\] which, solving for \(y\), becomes:

\[y=mx-m+2\]

which, substituted into the equation of the circle, gives:

\[(x+4)^2+(mx-m+5)^2=4\]

Now expand the squares and rearrange in \(x\):

\[x^2+16+8x+m^2x^2+m^2+25-2m^2x+10mx-10m-4=0\] \[(1+m^2)x^2+(-2m^2+10m+8)x+m^2-10m+37=0\]

Computing the discriminant of this equation and setting it equal to zero gives:

\[\Delta=0\] \[(-2m^2+10m+8)^2-4(1+m^2)(m^2-10m+37)=0\]

Expanding all the terms in the previous equation (left as an exercise for the reader), the terms of degree higher than two cancel out, giving

\[21m^2-50m+21=0\]

whose solution is

\[m_{1,2}=\frac{25\pm 2\sqrt{46}}{21} \]

The required lines are therefore

\[y-y_0=\frac{25+2\sqrt{46}}{21}(x-x_0)\] \[y-y_0=\frac{25-2\sqrt{46}}{21}(x-x_0)\]

Tangent to the circle-Exercise 2 - analytical method
Fig. 5 – Lines tangent to a circle of radius \(r=2\) centered at \(C(-4,-3)\), passing through the point \(P(1,2)\).

Tangent line drawn from a point on the circle (special case)

If the point \(P(x_0, y_0)\) lies on the circle, the simplest way to find the equation of the tangent line is based on the perpendicularity of the radius.

In this special case, the tangent line at \(P\) is, by construction, perpendicular to the radius \(CP\).

To find the equation of the tangent line, first compute the slope \(m\) of the radius \(CP\) using the familiar slope formula. Since the tangent line now passes through a point that lies on the circle rather than outside it, it follows that this line is perpendicular to the radius through \(P\). The slope of the tangent line can then be computed as

\[m_\perp=-\frac{1}{m}\]

The final equation of the tangent line in this case is:

\[y-y_0=-\frac{1}{m}(x-x_0)\]

Example:

Given the circle \(x^2 + y^2 = 25\) and the point \(P(3,4)\), after verifying that \(P\) lies on it, find the equation of the line tangent to the circle at \(P\).

SOLUTION

To verify that \(P\) actually lies on the circle, substitute its coordinates into the equation of the circle and check that the equation is satisfied:

\[3^2+4^2=25\] \[25=25\]

The point does indeed lie on the circle.

Applying the method described above, compute the slope \(m\) between the points \(C\) and \(P\), noting that the circle is centered at the origin \(C(0,0)\). This gives:

\[m=\frac{y_2-y_1}{x_2-x_1}=\frac{4-0}{3-0}=\frac{4}{3}\]

The slope of the line perpendicular to the radius is therefore

\[m_\perp=-\frac{3}{4}\]

Substituting these values gives the final equation of the line:

\[y-4=-\frac{3}{4}(x-3)\]

Tangent drawn from a point on the circle (special case)
Fig. 6 – Line tangent to the circle of equation \(x^2+y^2=25\) at the point \(P(3,4)\).

Vertical tangent line (another special case)

⚠️ Note

If one of the two tangent lines to the circle turns out to be vertical, condition (8) can still be applied, but only a single value of \(m\) will be found, corresponding to the non-vertical tangent line.

In practice, in this special case, equation (8) reduces to a first-degree equation, giving a single value of \(m\).

However, the vertical tangent line does exist — it simply cannot be found with this method!

WORKED EXAMPLE

Consider the equation of the circle:

\[x^2+y^2=1\] and the point of coordinates \(P(1,3)\), which gives the system:

\[\left\{\begin{matrix} x^2+y^2=1 \\y-3=m(x-1) \end{matrix}\right.\]

Eliminating \(y\) from the system, after simplifying and rearranging:

\[x^2+(m(x-1)+3)^2=1\]

Expand:

\[x^2 + [m^2(x-1)^2 + 6m(x-1) + 9] = 1\] \[x^2 + m^2(x^2-2x+1) + 6m(x-1) + 9 = 1\] \[x^2 + m^2x^2-2m^2x + m^2 + 6mx-6m + 9-1 = 0\] \[(1 + m^2)x^2 + (-2m^2 + 6m)x + (m^2-6m+8) = 0\]

For tangency, \(\Delta=0\) is required (discriminant of the quadratic in \(x\) equal to zero):

\[(-2m^2 + 6m)^2-4(1+m^2)(m^2-6m+8) = 0\]

which, simplified (the calculations are left to the reader as an exercise), becomes

\[24m-32=0 \implies m=\frac{32}{24}=\frac{4}{3}\]

Note: the quadratic terms cancel out, so, as anticipated, the equation reduces to a first-degree equation with a single value of \(m\), which is the slope of the line not parallel to the \(y\)-axis, of equation:

\[y-3=\frac{4}{3}(x-1)\]

The equation of the other line can be found through a simple geometric argument — for instance, noting that the \(x\)-coordinate of \(P\) coincides with the \(x\)-coordinate of the center of the circle plus its radius (0+1).

The equation of the vertical line is

\[x=1\]

Tangents to the circle from an external point, special case with vertical line
Fig. 7 – Special case of tangent lines to a circle drawn from an external point. Here, one of the two tangent lines is vertical.

Common mistakes to avoid

When calculating tangent lines to a circle, even small oversights can lead to significant errors. Here are the most frequent ones:

  • Using an “external” point that is actually internal: it is essential to first verify that the point from which the tangent lines are drawn is genuinely external to the circle. If the point lies inside the circle, no real tangent lines exist, and any attempt at a calculation will lead to impossible solutions.
  • Forgetting the condition \(d=r\) or \(\Delta = 0\): a tangent line “touches” the circle at exactly one point. This means that the distance between the center of the circle and the line must equal the radius, or, using the analytical method, that the discriminant of the quadratic equation obtained by substituting the line into the equation of the circle must be zero. Skipping this step inevitably leads to errors.
  • Confusing the slope of the radius with that of the tangent line: when the point lies on the circle, the tangent line is perpendicular to the radius. Confusing the slope of the radius with that of the tangent line is a classic mistake that completely changes the resulting line.
  • Not distinguishing between a point external to the circle and a point on the circle: the methods differ slightly. For a point on the circle, it is best to compute the slope of the tangent line directly through perpendicularity with the radius; for an external point, the distance or discriminant conditions apply instead.
  • Sign errors in the discriminant formulas: when expanding \(\Delta = 0\), it is easy to make a sign error while expanding the squares or multiplying terms. Even a small sign error can lead to completely wrong solutions, so it is best to proceed step by step and double-check every calculation.

Conclusions: which method to choose

Having covered both methods, a few practical observations can be drawn:

  • Distance method: more immediate and intuitive, ideal for students. It allows the tangent lines to be found in a few steps, without expanding a quadratic equation. It is well suited to practice exercises, quizzes, and tests.
  • Discriminant method \(\Delta=0\): more rigorous and general. It works for every conic, so not only for circles, but also for parabolas, ellipses, and hyperbolas. It helps build a deeper understanding of the analytical nature of tangency and develops the ability to apply algebra and geometry together.
  • Case of a point on the circle: here it is always faster to apply the perpendicularity condition between the radius and the tangent line. The slope of the tangent line follows directly from the negative reciprocal of the slope of the radius, avoiding longer calculations.

In summary, both methods lead to the same solutions, but the choice depends on the context:

  • For practice exercises and tests, the distance method is preferable.
  • For more advanced applications, to build analytical understanding of tangent lines, or to handle every conic, the discriminant method is essential.

For more on how a line and a circle relate to one another, see the guide on the relative position of a line and a circle.

Cite this resource

"This page didn't write itself — every word here was written and checked by hand. If it helped you, sharing it or citing it as a source helps it reach the next student who needs it."

Citation

Matheoria. (2026). Tangent Line to a Circle: Equation, Method, and Solved Examples. https://matheoria.org/tangent-line-to-circle/

HTML link to copy

<a href="https://matheoria.org/tangent-line-to-circle/">Tangent Line to a Circle: Equation, Method, and Solved Examples</a>