# Nakafa Framework: LLM

URL: /en/subject/high-school/12/mathematics/analytic-geometry/position-of-a-tangent-line-to-a-circle
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/subject/high-school/12/mathematics/analytic-geometry/position-of-a-tangent-line-to-a-circle/en.mdx

Output docs content for large language models.

---

export const metadata = {
  title: "Position of a Tangent Line to a Circle",
  description: "Master tangent lines to circles: find equations through points, with given slopes, and from external points. Interactive examples and step-by-step solutions.",
  authors: [{ name: "Nabil Akbarazzima Fatih" }],
  date: "05/26/2025",
  subject: "Analytic Geometry",
};

import { getColor } from "@repo/design-system/lib/color";
import { LineEquation } from "@repo/design-system/components/contents/line-equation";

## Understanding Tangent Lines to Circles

Imagine you're riding a bicycle on a circular track. At some point, you decide to leave the track in a straight line. Well, that straight line you're traveling on is what we call a **tangent line** to the circular track.

Mathematically, a tangent line to a circle is a straight line that touches the circle at exactly one point. This point of contact is called the **point of tangency**. What's interesting is that the tangent line is always **perpendicular** to the radius of the circle at that point of tangency.

This concept is very useful in various applications, such as designing highways that exit from roundabouts, determining the trajectory of objects leaving circular orbits, or even in optics to determine the direction of light reflection.

## Tangent Line Through a Point on the Circle

Let's start with the simplest case. When we already know the point of tangency, determining the equation of the tangent line becomes relatively easy.

<LineEquation
  title="Tangent Line Through a Point on the Circle"
  description="Visualization of a tangent line passing through a specific point on the circle."
  data={[
    {
      points: Array.from({ length: 361 }, (_, i) => {
        const angle = (i * Math.PI) / 180;
        const radius = 3;
        return {
          x: radius * Math.cos(angle),
          y: radius * Math.sin(angle),
          z: 0,
        };
      }),
      color: getColor("PURPLE"),
      showPoints: false,
    },
    {
      points: Array.from({ length: 1 }, () => {
        return {
          x: 0,
          y: 0,
          z: 0,
        };
      }),
      color: getColor("ORANGE"),
      showPoints: true,
      labels: [{ text: "O", at: 0, offset: [-0.5, -0.5, 0] }],
    },
    {
      points: Array.from({ length: 1 }, () => {
        const angle = Math.PI / 4;
        const radius = 3;
        return {
          x: radius * Math.cos(angle),
          y: radius * Math.sin(angle),
          z: 0,
        };
      }),
      color: getColor("CYAN"),
      showPoints: true,
      labels: [{ text: "T", at: 0, offset: [0.5, 0.5, 0] }],
    },
    {
      points: Array.from({ length: 2 }, (_, i) => {
        const angle = Math.PI / 4;
        const radius = 3;
        const tangentPoint = {
          x: radius * Math.cos(angle),
          y: radius * Math.sin(angle),
        };
        const radiusSlope = tangentPoint.y / tangentPoint.x;
        const tangentSlope = -1 / radiusSlope;
        
        const xRange = 4;
        return {
          x: tangentPoint.x + (i - 0.5) * xRange,
          y: tangentPoint.y + tangentSlope * (i - 0.5) * xRange,
          z: 0,
        };
      }),
      color: getColor("TEAL"),
      showPoints: false,
      smooth: false,
      labels: [{ text: "Tangent Line", at: 1, offset: [1, 2, 0] }],
    },
    {
      points: Array.from({ length: 2 }, (_, i) => {
        const angle = Math.PI / 4;
        const radius = 3;
        return {
          x: i * radius * Math.cos(angle),
          y: i * radius * Math.sin(angle),
          z: 0,
        };
      }),
      color: getColor("AMBER"),
      showPoints: false,
      smooth: false,
      labels: [{ text: "Radius", at: 1, offset: [-2, -0.5, 0] }],
    },
    {
      points: Array.from({ length: 2 }, (_, i) => {
        const xMin = -5;
        const xMax = 5;
        const y = 0;
        return {
          x: xMin + i * (xMax - xMin),
          y: y,
          z: 0,
        };
      }),
      color: getColor("ROSE"),
      showPoints: false,
      smooth: false,
    },
    {
      points: Array.from({ length: 2 }, (_, i) => {
        const yMin = -4;
        const yMax = 4;
        const x = 0;
        return {
          x: x,
          y: yMin + i * (yMax - yMin),
          z: 0,
        };
      }),
      color: getColor("ROSE"),
      showPoints: false,
      smooth: false,
    },
  ]}
  cameraPosition={[0, 0, 12]}
  showZAxis={false}
/>

For a circle with equation <InlineMath math="(x-a)^2 + (y-b)^2 = r^2" /> and point of tangency <InlineMath math="T(x_1, y_1)" />, we can determine the equation of the tangent line with the following steps:

**First step**: Calculate the slope of the radius from center <InlineMath math="O(a,b)" /> to the point of tangency <InlineMath math="T(x_1, y_1)" />:

<BlockMath math="m_{\text{radius}} = \frac{y_1 - b}{x_1 - a}" />

**Second step**: Since the tangent line is perpendicular to the radius, the slope of the tangent line is:

<BlockMath math="m_{\text{tangent}} = -\frac{x_1 - a}{y_1 - b}" />

**Third step**: Use the formula for the equation of a line with slope and one point:

<BlockMath math="(y - y_1) = m_{\text{tangent}}(x - x_1)" />

After simplification, we get the **practical formula** for the tangent line to a circle:

<BlockMath math="(x - a)(x_1 - a) + (y - b)(y_1 - b) = r^2" />

> This formula is very practical because we just need to substitute the coordinates of the circle's center, the point of tangency, and the radius squared.

## Tangent Line with Given Slope

Sometimes we're not given the point of tangency, but asked to find a tangent line that has a specific slope. For example, we want to find a tangent line that's parallel to a certain line.

<LineEquation
  title="Tangent Line with Given Slope"
  description="Two tangent lines with the same slope on a circle."
  data={[
    {
      points: Array.from({ length: 361 }, (_, i) => {
        const angle = (i * Math.PI) / 180;
        const radius = 2.5;
        return {
          x: radius * Math.cos(angle),
          y: radius * Math.sin(angle),
          z: 0,
        };
      }),
      color: getColor("PURPLE"),
      showPoints: false,
    },
    {
      points: Array.from({ length: 1 }, () => {
        return {
          x: 0,
          y: 0,
          z: 0,
        };
      }),
      color: getColor("ORANGE"),
      showPoints: true,
      labels: [{ text: "O", at: 0, offset: [-0.5, -0.5, 0] }],
    },
    {
      points: Array.from({ length: 2 }, (_, i) => {
        const m = 1; // given slope
        const r = 2.5;
        const c1 = r * Math.sqrt(1 + m * m);
        const xRange = 6;
        return {
          x: -xRange/2 + i * xRange,
          y: m * (-xRange/2 + i * xRange) + c1,
          z: 0,
        };
      }),
      color: getColor("TEAL"),
      showPoints: false,
      smooth: false,
      labels: [{ text: "Tangent 1", at: 0, offset: [0.5, 2.5, 0] }],
    },
    {
      points: Array.from({ length: 2 }, (_, i) => {
        const m = 1; // given slope
        const r = 2.5;
        const c2 = -r * Math.sqrt(1 + m * m);
        const xRange = 6;
        return {
          x: -xRange/2 + i * xRange,
          y: m * (-xRange/2 + i * xRange) + c2,
          z: 0,
        };
      }),
      color: getColor("CYAN"),
      showPoints: false,
      smooth: false,
      labels: [{ text: "Tangent 2", at: 1, offset: [0.5, -1.5, 0] }],
    },
    {
      points: Array.from({ length: 2 }, (_, i) => {
        const xMin = -5;
        const xMax = 5;
        const y = 0;
        return {
          x: xMin + i * (xMax - xMin),
          y: y,
          z: 0,
        };
      }),
      color: getColor("ROSE"),
      showPoints: false,
      smooth: false,
    },
    {
      points: Array.from({ length: 2 }, (_, i) => {
        const yMin = -4;
        const yMax = 4;
        const x = 0;
        return {
          x: x,
          y: yMin + i * (yMax - yMin),
          z: 0,
        };
      }),
      color: getColor("ROSE"),
      showPoints: false,
      smooth: false,
    },
  ]}
  cameraPosition={[0, 0, 12]}
  showZAxis={false}
/>

For circle <InlineMath math="x^2 + y^2 = r^2" /> and known slope <InlineMath math="m" />, we substitute the line equation <InlineMath math="y = mx + c" /> into the circle equation:

<div className="flex flex-col gap-4">
  <BlockMath math="x^2 + (mx + c)^2 = r^2" />
  <BlockMath math="x^2 + m^2x^2 + 2mcx + c^2 = r^2" />
  <BlockMath math="(1 + m^2)x^2 + 2mcx + (c^2 - r^2) = 0" />
</div>

Since the line is tangent to the circle, the discriminant of this quadratic equation must be zero:

<div className="flex flex-col gap-4">
  <BlockMath math="\Delta = (2mc)^2 - 4(1 + m^2)(c^2 - r^2) = 0" />
  <BlockMath math="4m^2c^2 - 4(1 + m^2)(c^2 - r^2) = 0" />
  <BlockMath math="m^2c^2 - (1 + m^2)c^2 + (1 + m^2)r^2 = 0" />
  <BlockMath math="-c^2 + (1 + m^2)r^2 = 0" />
  <BlockMath math="c^2 = (1 + m^2)r^2" />
</div>

Therefore, we obtain:

<BlockMath math="c = \pm r\sqrt{1 + m^2}" />

So, for every slope <InlineMath math="m" />, there are always **two tangent lines** with the equation:

<BlockMath math="y = mx \pm r\sqrt{1 + m^2}" />

## Tangent Line from External Point

The most interesting case is when we're asked to find tangent lines drawn from a point outside the circle. From one point outside the circle, we can draw exactly **two tangent lines**.

<LineEquation
  title="Tangent Line from Point Outside the Circle"
  description="Two tangent lines drawn from an external point to the circle."
  data={[
    {
      points: Array.from({ length: 361 }, (_, i) => {
        const angle = (i * Math.PI) / 180;
        const radius = 2;
        return {
          x: radius * Math.cos(angle),
          y: radius * Math.sin(angle),
          z: 0,
        };
      }),
      color: getColor("PURPLE"),
      showPoints: false,
    },
    {
      points: Array.from({ length: 1 }, () => {
        return {
          x: 0,
          y: 0,
          z: 0,
        };
      }),
      color: getColor("ORANGE"),
      showPoints: true,
      labels: [{ text: "O", at: 0, offset: [-0.5, -0.5, 0] }],
    },
    {
      points: Array.from({ length: 1 }, () => {
        return {
          x: 4,
          y: 2,
          z: 0,
        };
      }),
      color: getColor("ROSE"),
      showPoints: true,
      labels: [{ text: "P", at: 0, offset: [0.5, 0.5, 0] }],
    },
    {
      points: Array.from({ length: 1 }, () => {
        // First tangent point (calculated mathematically)
        const px = 4, py = 2, r = 2;
        const d = Math.sqrt(px*px + py*py);
        const angle1 = Math.atan2(py, px) - Math.acos(r/d);
        return {
          x: r * Math.cos(angle1),
          y: r * Math.sin(angle1),
          z: 0,
        };
      }),
      color: getColor("CYAN"),
      showPoints: true,
      labels: [{ text: "T₁", at: 0, offset: [0.5, -0.5, 0] }],
    },
    {
      points: Array.from({ length: 1 }, () => {
        // Second tangent point (calculated mathematically)
        const px = 4, py = 2, r = 2;
        const d = Math.sqrt(px*px + py*py);
        const angle2 = Math.atan2(py, px) + Math.acos(r/d);
        return {
          x: r * Math.cos(angle2),
          y: r * Math.sin(angle2),
          z: 0,
        };
      }),
      color: getColor("CYAN"),
      showPoints: true,
      labels: [{ text: "T₂", at: 0, offset: [0.5, 0.5, 0] }],
    },
    {
      points: Array.from({ length: 2 }, (_, i) => {
        // First tangent line
        const px = 4, py = 2, r = 2;
        const d = Math.sqrt(px*px + py*py);
        const angle1 = Math.atan2(py, px) - Math.acos(r/d);
        const t1x = r * Math.cos(angle1);
        const t1y = r * Math.sin(angle1);
        
        return {
          x: i === 0 ? px : t1x,
          y: i === 0 ? py : t1y,
          z: 0,
        };
      }),
      color: getColor("TEAL"),
      showPoints: false,
      smooth: false,
      labels: [{ text: "Tangent 1", at: 0, offset: [0.5, -1, 0] }],
    },
    {
      points: Array.from({ length: 2 }, (_, i) => {
        // Second tangent line
        const px = 4, py = 2, r = 2;
        const d = Math.sqrt(px*px + py*py);
        const angle2 = Math.atan2(py, px) + Math.acos(r/d);
        const t2x = r * Math.cos(angle2);
        const t2y = r * Math.sin(angle2);
        
        return {
          x: i === 0 ? px : t2x,
          y: i === 0 ? py : t2y,
          z: 0,
        };
      }),
      color: getColor("AMBER"),
      showPoints: false,
      smooth: false,
      labels: [{ text: "Tangent 2", at: 0, offset: [0.5, 1, 0] }],
    },
    {
      points: Array.from({ length: 2 }, (_, i) => {
        const xMin = -3;
        const xMax = 5;
        const y = 0;
        return {
          x: xMin + i * (xMax - xMin),
          y: y,
          z: 0,
        };
      }),
      color: getColor("ROSE"),
      showPoints: false,
      smooth: false,
    },
    {
      points: Array.from({ length: 2 }, (_, i) => {
        const yMin = -2;
        const yMax = 4;
        const x = 0;
        return {
          x: x,
          y: yMin + i * (yMax - yMin),
          z: 0,
        };
      }),
      color: getColor("ROSE"),
      showPoints: false,
      smooth: false,
    },
  ]}
  cameraPosition={[0, 0, 12]}
  showZAxis={false}
/>

To determine the equation of tangent lines from point <InlineMath math="P(x_0, y_0)" /> outside circle <InlineMath math="(x-a)^2 + (y-b)^2 = r^2" />, we use the concept of **polar line**.

The equation of the polar line of point <InlineMath math="P(x_0, y_0)" /> with respect to the circle is:

<BlockMath math="(x-a)(x_0-a) + (y-b)(y_0-b) = r^2" />

This polar line is **the line connecting the two points of tangency** from point <InlineMath math="P" /> to the circle. So, to find the tangent points, we need to:

1. Determine the equation of the polar line
2. Find the intersection points of the polar line with the circle
3. Use both tangent points to determine the equations of the tangent lines

> This polar line concept is very elegant because it provides a systematic way to solve tangent line problems from external points.

## Application Example

Let's look at a concrete example. Given circle <InlineMath math="L \equiv (x+1)^2 + (y-2)^2 = 9" /> and point <InlineMath math="B(2, 6)" /> which is outside the circle.

**Step 1**: Determine the equation of the polar line of point <InlineMath math="B(2, 6)" /> with respect to the circle:

<div className="flex flex-col gap-4">
  <BlockMath math="(x-(-1))(2-(-1)) + (y-2)(6-2) = 9" />
  <BlockMath math="(x+1)(3) + (y-2)(4) = 9" />
  <BlockMath math="3x + 3 + 4y - 8 = 9" />
  <BlockMath math="3x + 4y = 14" />
</div>

**Step 2**: Find the intersection points of the polar line <InlineMath math="3x + 4y = 14" /> with the circle. From the line equation, we get <InlineMath math="x = \frac{14-4y}{3}" />. Substitute into the circle equation:

<div className="flex flex-col gap-4">
  <BlockMath math="(\frac{14-4y}{3} + 1)^2 + (y-2)^2 = 9" />
  <BlockMath math="(\frac{17-4y}{3})^2 + (y-2)^2 = 9" />
</div>

After solving, we'll get two tangent points. Then use those points to determine the equations of the tangent lines.

## Practice

1. Determine the equation of the tangent line to circle <InlineMath math="x^2 + y^2 = 25" /> at point <InlineMath math="(3, 4)" />.

2. Find the equation of tangent lines to circle <InlineMath math="x^2 + y^2 = 16" /> that are parallel to line <InlineMath math="y = 2x + 5" />.

3. Determine the equation of tangent lines to circle <InlineMath math="(x-1)^2 + (y+2)^2 = 8" /> passing through point <InlineMath math="(4, 2)" />.

4. A circle has the equation <InlineMath math="x^2 + y^2 - 4x + 6y - 3 = 0" />. Determine the equation of tangent lines that are perpendicular to line <InlineMath math="x + 2y = 7" />.

### Answer Key

1. **Solution**:

   For circle <InlineMath math="x^2 + y^2 = 25" /> with center <InlineMath math="O(0,0)" /> and radius <InlineMath math="r = 5" />, and tangent point <InlineMath math="T(3,4)" />.
   
   Using the tangent line formula: <InlineMath math="(x-a)(x_1-a) + (y-b)(y_1-b) = r^2" />
   
   <div className="flex flex-col gap-4">
     <BlockMath math="(x-0)(3-0) + (y-0)(4-0) = 25" />
     <BlockMath math="3x + 4y = 25" />
   </div>
   
   Therefore, the tangent line equation is <InlineMath math="3x + 4y = 25" />.

2. **Solution**:

   A line parallel to <InlineMath math="y = 2x + 5" /> has slope <InlineMath math="m = 2" />.
   
   For circle <InlineMath math="x^2 + y^2 = 16" /> with <InlineMath math="r = 4" />, using the formula:
   
   <BlockMath math="y = mx \pm r\sqrt{1 + m^2}" />
   
   <div className="flex flex-col gap-4">
     <BlockMath math="y = 2x \pm 4\sqrt{1 + 4}" />
     <BlockMath math="y = 2x \pm 4\sqrt{5}" />
   </div>
   
   Therefore, there are two tangent lines: <InlineMath math="y = 2x + 4\sqrt{5}" /> and <InlineMath math="y = 2x - 4\sqrt{5}" />.

3. **Solution**:

   Circle <InlineMath math="(x-1)^2 + (y+2)^2 = 8" /> has center <InlineMath math="(1,-2)" /> and <InlineMath math="r^2 = 8" />.
   
   Polar line equation for point <InlineMath math="(4,2)" />:
   
   <div className="flex flex-col gap-4">
     <BlockMath math="(x-1)(4-1) + (y-(-2))(2-(-2)) = 8" />
     <BlockMath math="3(x-1) + 4(y+2) = 8" />
     <BlockMath math="3x - 3 + 4y + 8 = 8" />
     <BlockMath math="3x + 4y = 3" />
   </div>
   
   Find intersection points with the circle to get the tangent points, then determine the tangent line equations through each tangent point and point <InlineMath math="(4,2)" />.

4. **Solution**:

   Convert the circle equation to standard form by completing the square:
   
   <div className="flex flex-col gap-4">
     <BlockMath math="x^2 + y^2 - 4x + 6y - 3 = 0" />
     <BlockMath math="(x^2 - 4x + 4) + (y^2 + 6y + 9) = 3 + 4 + 9" />
     <BlockMath math="(x-2)^2 + (y+3)^2 = 16" />
   </div>
   
   Center <InlineMath math="(2,-3)" />, radius <InlineMath math="r = 4" />.
   
   Line <InlineMath math="x + 2y = 7" /> can be written as <InlineMath math="y = -\frac{1}{2}x + \frac{7}{2}" />, so its slope is <InlineMath math="m_1 = -\frac{1}{2}" />.
   
   A line perpendicular to it has slope <InlineMath math="m = 2" />.
   
   For the circle with center <InlineMath math="(2,-3)" />, the tangent line equation with slope 2:
   
   <div className="flex flex-col gap-4">
     <BlockMath math="y - (-3) = 2(x - 2) \pm 4\sqrt{1 + 4}" />
     <BlockMath math="y + 3 = 2x - 4 \pm 4\sqrt{5}" />
     <BlockMath math="y = 2x - 7 \pm 4\sqrt{5}" />
   </div>
   
   Therefore, the two tangent lines are: <InlineMath math="y = 2x - 7 + 4\sqrt{5}" /> and <InlineMath math="y = 2x - 7 - 4\sqrt{5}" />.