# Nakafa Framework: LLM

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

Output docs content for large language models.

---

export const metadata = {
  title: "Equation of Circle",
  description: "Learn circle equations from (x-h)² + (y-k)² = r² to general form. Master finding center, radius, and converting between forms with practice problems.",
  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 Circle Equations

Circle equation is a mathematical formula that describes all points forming a circle on a coordinate plane. Imagine you have a compass and want to draw a circle on coordinate paper. Well, the circle equation tells us which coordinates the compass pencil tip will pass through.

Why is this useful? Because by knowing the circle equation, we can immediately tell where the **center of the circle** is and what its **radius** is without having to draw the circle first.

## Circle Centered at Origin

Let's start with the easiest case first: a circle whose center is at the origin <InlineMath math="O(0,0)" />. 

If we have a circle with center at <InlineMath math="O(0,0)" /> and radius <InlineMath math="r" />, then every point <InlineMath math="(x,y)" /> on that circle has the same distance from the center, which is <InlineMath math="r" />.

Using the distance formula, we get:

<BlockMath math="\sqrt{x^2 + y^2} = r" />

If we square both sides, we get the circle equation with center at origin:

<BlockMath math="x^2 + y^2 = r^2" />

Let's visualize this first.

<LineEquation
  title="Circle with Center at Origin"
  description={<>Circle with center <InlineMath math="O(0,0)" /> and radius 3.</>}
  data={[
    {
      points: Array.from({ length: 361 }, (_, i) => {
        const angle = (i * Math.PI) / 180;
        return {
          x: 3 * Math.cos(angle),
          y: 3 * Math.sin(angle),
          z: 0,
        };
      }),
      color: getColor("PURPLE"),
      showPoints: false,
    },
    {
      points: Array.from({ length: 2 }, (_, i) => {
        const center = { x: 0, y: 0 };
        const radius = 3;
        const angle = 0;
        return {
          x: center.x + i * radius * Math.cos(angle),
          y: center.y + i * radius * Math.sin(angle),
          z: 0,
        };
      }),
      color: getColor("ORANGE"),
      showPoints: true,
      labels: [
        { text: "O(0,0)", at: 0, offset: [-0.5, -0.5, 0] },
        { text: "r = 3", at: 1, offset: [0, -0.5, 0] },
      ],
    },
    {
      points: Array.from({ length: 2 }, (_, i) => {
        const xMin = -4;
        const xMax = 4;
        const y = 0;
        return {
          x: xMin + i * (xMax - xMin),
          y: y,
          z: 0,
        };
      }),
      color: getColor("AMBER"),
      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("AMBER"),
      showPoints: false,
      smooth: false,
    },
  ]}
  cameraPosition={[0, 0, 10]}
  showZAxis={false}
/>

For the circle above, the equation is <InlineMath math="x^2 + y^2 = 9" /> because the radius is 3, so <InlineMath math="r^2 = 3^2 = 9" />.

## Circle with Arbitrary Center

Now what if the center isn't at the origin? Say the circle center is at point <InlineMath math="P(a,b)" /> with radius <InlineMath math="r" />.

Every point <InlineMath math="(x,y)" /> on this circle must have the same distance <InlineMath math="r" /> from center <InlineMath math="P(a,b)" />. Using the distance formula:

<BlockMath math="\sqrt{(x-a)^2 + (y-b)^2} = r" />

After squaring, we get the **general circle equation**:

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

If we visualize this, it will look like this:

<LineEquation
  title="Circle with Arbitrary Center"
  description={<>Circle with center <InlineMath math="P(2,-1)" /> and radius 2.</>}
  data={[
    {
      points: Array.from({ length: 361 }, (_, i) => {
        const angle = (i * Math.PI) / 180;
        return {
          x: 2 + 2 * Math.cos(angle),
          y: -1 + 2 * Math.sin(angle),
          z: 0,
        };
      }),
      color: getColor("PURPLE"),
      showPoints: false,
    },
    {
      points: Array.from({ length: 2 }, (_, i) => {
        const center = { x: 2, y: -1 };
        const radius = 2;
        const angle = 0;
        return {
          x: center.x + i * radius * Math.cos(angle),
          y: center.y + i * radius * Math.sin(angle),
          z: 0,
        };
      }),
      color: getColor("ORANGE"),
      showPoints: true,
      labels: [
        { text: "P(2,-1)", at: 0, offset: [-0.5, 0.5, 0] },
        { text: "r = 2", at: 1, offset: [0, -0.5, 0] },
      ],
    },
    {
      points: Array.from({ length: 2 }, (_, i) => {
        const xMin = -1;
        const xMax = 5;
        const y = 0;
        return {
          x: xMin + i * (xMax - xMin),
          y: y,
          z: 0,
        };
      }),
      color: getColor("AMBER"),
      showPoints: false,
      smooth: false,
    },
    {
      points: Array.from({ length: 2 }, (_, i) => {
        const yMin = -4;
        const yMax = 2;
        const x = 0;
        return {
          x: x,
          y: yMin + i * (yMax - yMin),
          z: 0,
        };
      }),
      color: getColor("AMBER"),
      showPoints: false,
      smooth: false,
    },
  ]}
  cameraPosition={[0, 0, 10]}
  showZAxis={false}
/>

The equation of the circle above is <InlineMath math="(x-2)^2 + (y+1)^2 = 4" /> because the center is <InlineMath math="P(2,-1)" /> and the radius is 2, so <InlineMath math="r^2 = 2^2 = 4" />.

## General Form of Circle Equation

Sometimes we find circle equations that have already been expanded into general form. For example, from the equation <InlineMath math="(x-1)^2 + (y-2)^2 = 9" />, if we expand it:

<div className="flex flex-col gap-4">
  <BlockMath math="(x-1)^2 + (y-2)^2 = 9" />
  <BlockMath math="x^2 - 2x + 1 + y^2 - 4y + 4 = 9" />
  <BlockMath math="x^2 + y^2 - 2x - 4y + 5 = 9" />
  <BlockMath math="x^2 + y^2 - 2x - 4y - 4 = 0" />
</div>

This last form is called the **general form of circle equation**:

<BlockMath math="x^2 + y^2 + Dx + Ey + F = 0" />

If we have an equation in general form, we can convert it back to standard form using **completing the square** technique.

> Not all equations of the form <InlineMath math="x^2 + y^2 + Dx + Ey + F = 0" /> are circle equations. The condition is <InlineMath math="D^2 + E^2 - 4F > 0" />. If this value is zero, then it's just a single point, and if negative, then there's no curve at all.

## Determining Center and Radius

From the standard form <InlineMath math="(x-a)^2 + (y-b)^2 = r^2" />, we can directly know:

The center is at <InlineMath math="(a,b)" /> and the radius is <InlineMath math="r" /> (obtained from <InlineMath math="r = \sqrt{r^2}" />).

While from the general form <InlineMath math="x^2 + y^2 + Dx + Ey + F = 0" />, we can determine:

<div className="flex flex-col gap-4">
  <BlockMath math="\text{Center: } \left(-\frac{D}{2}, -\frac{E}{2}\right)" />
  <BlockMath math="\text{Radius: } r = \frac{1}{2}\sqrt{D^2 + E^2 - 4F}" />
</div>

## Practice Problems

1. Determine the equation of a circle centered at <InlineMath math="(3,-2)" /> with radius 5.

2. Given a circle with equation <InlineMath math="x^2 + y^2 - 6x + 4y - 12 = 0" />. Determine the center and radius of the circle.

3. A circle passes through point <InlineMath math="(6,-8)" /> and is centered at <InlineMath math="O(0,0)" />. Determine the equation of the circle.

4. Determine the equation of a circle that has a diameter with endpoints at <InlineMath math="A(1,3)" /> and <InlineMath math="B(7,-1)" />.

### Answer Key

1. **Solution**: 

   Given center <InlineMath math="(a,b) = (3,-2)" /> and radius <InlineMath math="r = 5" />.
   
   Using the circle equation formula:
   
   <div className="flex flex-col gap-4">
     <BlockMath math="(x-a)^2 + (y-b)^2 = r^2" />
     <BlockMath math="(x-3)^2 + (y-(-2))^2 = 5^2" />
     <BlockMath math="(x-3)^2 + (y+2)^2 = 25" />
   </div>
   
   So the circle equation is <InlineMath math="(x-3)^2 + (y+2)^2 = 25" />.

2. **Solution**:

   From the equation <InlineMath math="x^2 + y^2 - 6x + 4y - 12 = 0" />, we identify the coefficients:
   
   <InlineMath math="D = -6" />, <InlineMath math="E = 4" />, <InlineMath math="F = -12" />
   
   <div className="flex flex-col gap-4">
     <BlockMath math="\text{Center: } \left(-\frac{D}{2}, -\frac{E}{2}\right) = \left(-\frac{(-6)}{2}, -\frac{4}{2}\right) = (3, -2)" />
     <BlockMath math="r = \frac{1}{2}\sqrt{D^2 + E^2 - 4F} = \frac{1}{2}\sqrt{(-6)^2 + 4^2 - 4(-12)}" />
     <BlockMath math="r = \frac{1}{2}\sqrt{36 + 16 + 48} = \frac{1}{2}\sqrt{100} = \frac{1}{2} \times 10 = 5" />
   </div>
   
   So the circle center is at <InlineMath math="(3,-2)" /> with radius 5.

3. **Solution**:

   Since the circle is centered at <InlineMath math="O(0,0)" /> and passes through point <InlineMath math="(6,-8)" />, the radius is the distance from the center to that point.
   
   <BlockMath math="r = \sqrt{(6-0)^2 + (-8-0)^2} = \sqrt{6^2 + (-8)^2} = \sqrt{36 + 64} = \sqrt{100} = 10" />
   
   The circle equation: <InlineMath math="x^2 + y^2 = r^2 = 10^2 = 100" />

4. **Solution**:

   The circle center is the midpoint of diameter <InlineMath math="AB" />:
   
   <BlockMath math="\text{Center} = \left(\frac{x_A + x_B}{2}, \frac{y_A + y_B}{2}\right) = \left(\frac{1+7}{2}, \frac{3+(-1)}{2}\right) = \left(\frac{8}{2}, \frac{2}{2}\right) = (4, 1)" />
   
   The radius is half the diameter length:
   
   <div className="flex flex-col gap-4">
     <BlockMath math="\text{Length } AB = \sqrt{(x_B-x_A)^2 + (y_B-y_A)^2} = \sqrt{(7-1)^2 + (-1-3)^2}" />
     <BlockMath math="= \sqrt{6^2 + (-4)^2} = \sqrt{36 + 16} = \sqrt{52} = \sqrt{4 \times 13} = 2\sqrt{13}" />
     <BlockMath math="r = \frac{\text{diameter}}{2} = \frac{2\sqrt{13}}{2} = \sqrt{13}" />
   </div>
   
   The circle equation: <InlineMath math="(x-4)^2 + (y-1)^2 = (\sqrt{13})^2 = 13" />