Advertisement
Advertisement
GEOMETRY

Tangent Line to a Circle Calculator — tangent length, contact points and line equations

Enter a circle and a point and get the tangent length, both points of contact, both tangent line equations and the angle between them, with a written explanation when no tangent exists.

Must be strictly positive. A circle of radius zero is a single point and has no tangent lines in the usual sense.
Two tangents exist when this point lies outside the circle, exactly one when it lies on the circle, and none when it lies inside.
Display precision only; the arithmetic runs at full double precision.
Tangent length from the point to the circle
 
Distance to the centre
Number of tangents
Angle between the tangents
Power of the point
Points of contact:
Tangent line equations:
Verification:
Working:
Tip: the tangent length is the same for both tangents from any external point, which is why the two tangent segments from a point to a circle are always equal. That equality is the fact most tangent problems are built on.
Advertisement

The tangent line to a circle calculator above solves the standard construction: given a circle and a point outside it, find the two lines through that point which touch the circle exactly once. It returns the length of each tangent segment, the coordinates of both points of contact, the equation of each tangent line in slope-intercept and general form, and the angle the two tangents make with each other.

Arb Digital publishes it because the tangent construction is a genuinely different calculation from anything about the circle itself. Our circle equation calculator converts between the general and standard forms and extracts the centre and radius, and the circle calculator handles area, circumference and the relationships between them. Neither touches the external-point geometry, which needs the right-angle property and a distance calculation rather than an equation rearrangement.

What This Tangent Line Calculator Does

It takes the circle as a centre and a radius, and a point anywhere in the plane. The first thing it computes is the distance from that point to the centre, because that single number decides the whole problem: greater than the radius gives two tangents, equal gives exactly one, and less gives none.

When two tangents exist it returns the tangent length, which is the distance from the external point to either point of contact and is the same for both. It gives both contact points explicitly, both line equations, and the angle between the tangents. It also reports the power of the point, which is the squared tangent length and appears throughout circle geometry.

The degenerate cases are handled in words rather than by returning blanks. A point exactly on the circle has one tangent, the line perpendicular to the radius at that point, and the tool returns that line. A point inside the circle has no tangent through it, and the tool says so and explains why rather than producing an imaginary answer.

How to Use It

  1. Enter the circle centre and radius. If you have the circle in general form instead, convert it first with the circle equation calculator and bring the centre and radius back here.
  2. Enter the point. It can be anywhere. The tool decides for itself whether it is outside, on or inside the circle and responds accordingly.
  3. Read the tangent length first. It is the headline number and is what most tangent problems are actually asking for.
  4. Check the contact points and equations in the panels below. Each line is given in both slope-intercept form, where it exists, and general form, which always exists.
  5. Read the verification panel, which confirms independently that each contact point lies on the circle and that each line sits exactly a radius away from the centre.

The Formula and How It Is Calculated

Everything follows from one fact: a tangent line is perpendicular to the radius at the point where it touches. That makes the centre, the point of contact and the external point the vertices of a right triangle with the right angle at the contact point. Pythagoras then gives the tangent length immediately: L = √(d² − r²), where d is the distance from the external point to the centre. The MathWorld entry on circle tangent lines derives the construction in full.

The contact points come from the same triangle. Write the vector from the centre to the external point as (dx, dy) with length d. The contact points are found by moving a distance r²/d along that direction from the centre, then stepping sideways by rL/d perpendicular to it, once in each direction. In coordinates that gives contact points at (h + r²dx/d² ∓ rL·dy/d², k + r²dy/d² ± rL·dx/d²).

The angle between the two tangents is 2 arcsin(r/d), because half that angle sits in the right triangle opposite the radius and adjacent to the hypotenuse d. As the point moves far away the angle shrinks towards zero and the tangents become parallel; as the point approaches the circle the angle opens towards one hundred and eighty degrees.

Worked example with the default values: a circle of radius 3 centred at the origin and the point (5, 0). The distance d is 5, so the tangent length is the square root of 25 minus 9, which is 4 exactly. The scaling factor r²/d² is 9/25, or 0.36, and the perpendicular factor rL/d² is 12/25, or 0.48. The contact points are therefore (1.8, 2.4) and (1.8, −2.4). Check the first: 1.8 squared plus 2.4 squared is 3.24 plus 5.76, which is 9, so it lies on the circle. The line through (5, 0) and (1.8, 2.4) has slope −0.75 and equation 3x + 4y = 15, whose distance from the origin is 15 divided by 5, which is exactly 3. The angle between the tangents is twice the arcsine of 0.6, which is 73.7398 degrees.

Advertisement

The Power of a Point and Why It Matters

The power of a point with respect to a circle is d² minus r². For an external point it is exactly the squared tangent length, which is why the two quantities appear together here. For a point inside the circle it is negative, and its magnitude is the product of the two segments any chord through the point is cut into. For a point on the circle it is zero.

The value of the concept is that it is the same along every line through the point. Draw any secant from an external point cutting the circle at two places, and the product of the two distances equals the power, and therefore equals the squared tangent length. That is the tangent-secant theorem, and it is what lets you compute a tangent length without ever constructing a tangent.

It also gives the radical axis. The set of points with equal power with respect to two circles is a straight line, perpendicular to the line joining the centres, and it is where a common tangent construction gets its footing. For two intersecting circles it is the line through the intersection points, which is a surprising and useful fact given that the definition mentions no intersections at all.

The Three Cases and What They Look Like

The point outside the circle is the interesting case: two distinct tangents, two contact points, a positive tangent length, and a well-defined angle between them. The two tangent segments are equal, and the line from the external point to the centre bisects both the angle between the tangents and the chord joining the contact points.

The point exactly on the circle collapses everything. The tangent length is zero, the two contact points merge into the given point, and the two tangent lines merge into one: the line through that point perpendicular to the radius. The tool detects this within a small numerical tolerance, because exact equality of floating-point distances is unreliable, and returns the single tangent.

The point inside the circle admits no tangent at all. Every line through an interior point cuts the circle twice, so none can touch it once. Algebraically, d² minus r² is negative and its square root is imaginary. The tool reports this in words. Some references speak of imaginary tangents in this case, which is meaningful in projective and complex geometry but has no interpretation as a real line you could draw.

Tangents in Slope Form and the Vertical Line Trap

A common textbook approach writes the tangent as y = mx + c through the external point, substitutes into the circle equation, and forces the discriminant to zero. It works and it produces the two slopes directly. It also fails silently in one case: when one of the tangents is vertical, its slope is undefined and the quadratic in m loses a root without warning. You get one tangent when there should be two, and nothing tells you.

This happens whenever the external point sits directly above or below the circle at horizontal distance exactly r from the centre, which is not an exotic configuration. The vector construction used on this page has no such blind spot, because it never parameterises by slope. That is why every equation here is also given in general form Ax + By + C = 0, which represents vertical lines perfectly well. Our slope calculator and line intersection calculator handle the related line problems.

Where the Tangent Construction Is Used

Belt and pulley layouts are tangent problems: a belt running between two pulleys of different radii follows the common external tangent, and its length is a sum of tangent segments and arc lengths. Cam and follower design uses the same geometry. In road design, a curve joining two straight sections must be tangent to both at the transition points, or the steering input jumps discontinuously.

Computer graphics uses tangent lines for silhouette detection, since the visible outline of a sphere from a viewpoint is exactly the circle of tangency. Navigation and collision avoidance use them to find the shortest path that clears a circular exclusion zone: the optimal route runs along a tangent, around an arc, and out along the other tangent. Our great circle distance calculator covers the related problem on the surface of a sphere, and the unit circle calculator the trigonometric relationships behind the angle formula. The general properties of the circle are set out in the MathWorld entry on the circle.

Need a build where the geometry is actually correct?

Arb Digital designs and builds interactive tools and product experiences where the underlying maths is verified rather than assumed.

See Our Web Design Work Talk To Our Team

Common Mistakes to Avoid

  • Using the distance to the centre as the tangent length — the tangent length is the other leg of the right triangle, the square root of d squared minus r squared.
  • Solving by slope and missing the vertical tangent — the quadratic in m silently loses a root whenever one tangent is vertical, and nothing in the algebra warns you.
  • Assuming the contact point is on the line from the point to the centre — it is not. That line bisects the angle between the tangents and passes between the two contact points.
  • Taking a square root of a negative power — a point inside the circle has no real tangent, and an imaginary answer is not a line you can draw.
  • Forgetting the radius must be positive — a zero radius makes the circle a point, and the tangent construction degenerates to any line through it.

Related Free Tools From Arb Digital

Convert a circle between forms with the circle equation calculator, get area and circumference with the circle calculator, work with angles on the unit circle using the unit circle calculator, find where two lines meet with the line intersection calculator, or compute gradients with the slope calculator. The full free online tools hub lists every geometry tool we publish.

Frequently Asked Questions

How many tangent lines can be drawn from a point to a circle?

Two if the point is outside the circle, exactly one if the point lies on the circle, and none if the point is inside it. The distance from the point to the centre decides which case applies.

What is the tangent length formula?

The square root of d squared minus r squared, where d is the distance from the external point to the centre and r is the radius. It follows from Pythagoras, because the tangent is perpendicular to the radius at the contact point.

Are the two tangent segments from a point always equal?

Yes. Both are legs of congruent right triangles sharing the hypotenuse from the point to the centre and having equal radii, so the two tangent lengths must be equal.

What is the power of a point?

The distance to the centre squared minus the radius squared. For an external point it equals the squared tangent length, and along any secant it equals the product of the two distances to the intersection points.

How do I find the angle between the two tangents?

It is twice the arcsine of the radius divided by the distance to the centre. The angle shrinks towards zero as the point moves away and opens towards a straight line as the point approaches the circle.

Why does the slope method sometimes give only one tangent?

Because a vertical line has no slope, so the quadratic in m cannot represent it and quietly returns one root instead of two. The vector construction used here has no such blind spot.

What is the tangent line at a point that lies on the circle?

The line through that point perpendicular to the radius there. In coordinates it is (x₀ − h)(x − h) + (y₀ − k)(y − k) = r², which is the circle equation with one copy of each variable replaced by the contact point.

Does the line from the point to the centre pass through a contact point?

No, except in the degenerate case where the point is on the circle. That line bisects the angle between the tangents and crosses the chord joining the two contact points at right angles.

This page explains a geometric construction for educational purposes. All coordinates are computed in double-precision floating point, so a point extremely close to the circle may be classified as being on it within the tool's numerical tolerance.

Advertisement
Advertisement

Take it further