# Nakafa Learning Content

> For AI agents: use [llms.txt](https://nakafa.com/llms.txt) for the site index. Markdown versions are available by appending `.md` to content URLs or sending `Accept: text/markdown`.

URL: https://nakafa.com/en/subjects/mathematics/geometric-transformation/reflection-over-y-equals-x
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/material/lesson/mathematics/geometric-transformation/reflection-over-y-equals-x/en.mdx

Learn coordinate exchange in reflections over y = x through examples with points, triangles, and equations.

---

## Understanding Reflection over the Main Diagonal Line

Reflection over the line $$y = x$$ is a geometric transformation that maps every point of an object to a new position with the line $$y = x$$ acting as a mirror.

Visible text: Reflection over the line is a geometric transformation that maps every point of an object to a new position with the line acting as a mirror.

The distance from the original point to the mirror line is equal to the distance from the image point to the mirror line, and the line connecting the original point to its image will be perpendicular to the line $$y = x$$.

Visible text: The distance from the original point to the mirror line is equal to the distance from the image point to the mirror line, and the line connecting the original point to its image will be perpendicular to the line .

### Rule for Reflection over the Main Diagonal Line

If a point $$P(x, y)$$ is reflected over the line $$y = x$$, its image's coordinates, <InlineMath math="P'(x', y')" />, will follow a simple rule:

Visible text: If a point is reflected over the line , its image's coordinates, <InlineMath math="P'(x', y')" />, will follow a simple rule:

Component: MathContainer
Children:

```math
x' = y
```

```math
y' = x
```

Thus, the image of point $$P(x, y)$$ is <InlineMath math="P'(y, x)" />. Notice that the $$x$$ and $$y$$ coordinates swap positions.

Visible text: Thus, the image of point is <InlineMath math="P'(y, x)" />. Notice that the and coordinates swap positions.

## Reflecting a Point

Suppose we have point $$A(1, 4)$$. If point $$A$$ is reflected over the line $$y = x$$, its image, <InlineMath math="A'" />, can be determined by swapping its coordinates:

Visible text: Suppose we have point . If point is reflected over the line , its image, <InlineMath math="A'" />, can be determined by swapping its coordinates:

The original $$x$$-coordinate is $$1$$, becoming the new $$y$$-coordinate.

Visible text: The original -coordinate is , becoming the new -coordinate.

The original $$y$$-coordinate is $$4$$, becoming the new $$x$$-coordinate.

Visible text: The original -coordinate is , becoming the new -coordinate.

Thus, the image of point $$A$$ is <InlineMath math="A'(4, 1)" />.

Visible text: Thus, the image of point is <InlineMath math="A'(4, 1)" />.

Let's visualize this along with some other points:

Component: LineEquation
Props:
- title: Image of Points over the Line $$y=x$$
  Visible text: Image of Points over the Line
- description: Visualization of the reflection of several points over the line{" "}
$$y=x$$.
  Visible text: Visualization of the reflection of several points over the line{" "}
.
- data: [
{
points: [
{ x: -6, y: -6, z: 0 },
{ x: 6, y: 6, z: 0 },
],
color: getColor("PURPLE"),
labels: [{ text: "y=x", at: 1, offset: [0.5, -0.5, 0] }],
}, // Reflection line
// Point A and A'
{
points: [{ x: 1, y: 4, z: 0 }],
color: getColor("EMERALD"),
showPoints: true,
labels: [{ text: "A(1,4)", at: 0, offset: [0.3, 0.3, 0] }],
},
{
points: [{ x: 4, y: 1, z: 0 }],
color: getColor("EMERALD"), // Keeping color consistent for original and image as per user's id.mdx edit pattern
showPoints: true,
labels: [{ text: "A'(4,1)", at: 0, offset: [0.3, 0.3, 0] }],
},
// Point B and B'
{
points: [{ x: -2, y: 2, z: 0 }],
color: getColor("AMBER"),
showPoints: true,
labels: [{ text: "B(-2,2)", at: 0, offset: [0.3, 0.3, 0] }],
},
{
points: [{ x: 2, y: -2, z: 0 }],
color: getColor("AMBER"),
showPoints: true,
labels: [{ text: "B'(2,-2)", at: 0, offset: [0.3, 0.3, 0] }],
},
// Point C and C'
{
points: [{ x: -1, y: -3, z: 0 }],
color: getColor("ROSE"),
showPoints: true,
labels: [{ text: "C(-1,-3)", at: 0, offset: [0.3, 0.3, 0] }],
},
{
points: [{ x: -3, y: -1, z: 0 }],
color: getColor("ROSE"),
showPoints: true,
labels: [{ text: "C'(-3,-1)", at: 0, offset: [0.3, 0.3, 0] }],
},
]
- showZAxis: false
- cameraPosition: [0, 0, 15]

## Reflecting a Triangle

Determine the image of triangle $$ABC$$ with vertices $$A(-2,4)$$, $$B(3,1)$$, and $$C(-3,-1)$$ reflected over the line $$y=x$$.

Visible text: Determine the image of triangle with vertices , , and reflected over the line .

To reflect the triangle, we reflect each of its vertices over the line $$y=x$$:

Visible text: To reflect the triangle, we reflect each of its vertices over the line :

1.  Point $$A(-2, 4)$$: Its image is <InlineMath math="A'(4, -2)" />.
2.  Point $$B(3, 1)$$: Its image is <InlineMath math="B'(1, 3)" />.
3.  Point $$C(-3, -1)$$: Its image is <InlineMath math="C'(-1, -3)" />.

Visible text: 1. Point : Its image is <InlineMath math="A'(4, -2)" />.
2. Point : Its image is <InlineMath math="B'(1, 3)" />.
3. Point : Its image is <InlineMath math="C'(-1, -3)" />.

The image triangle <InlineMath math="A'B'C'" /> is formed by connecting the points <InlineMath math="A'(4, -2)" />, <InlineMath math="B'(1, 3)" />, and <InlineMath math="C'(-1, -3)" />.

Component: LineEquation
Props:
- title: Triangle $$ABC$$ and its Image{" "}
<InlineMath math="A'B'C'" /> over $$y=x$$
  Visible text: Triangle and its Image{" "}
<InlineMath math="A'B'C'" /> over
- description: Visualization of the reflection of triangle $$ABC$$ over
the line $$y=x$$.
  Visible text: Visualization of the reflection of triangle over
the line .
- data: [
{
points: [
{ x: -7, y: -7, z: 0 },
{ x: 7, y: 7, z: 0 },
],
color: getColor("PURPLE"),
labels: [{ text: "y=x", at: 1, offset: [0.5, -0.5, 0] }],
}, // Reflection line
// Triangle ABC (Original)
...[
{
from: { x: -2, y: 4, z: 0, label: "A(-2,4)" },
to: { x: 3, y: 1, z: 0, label: "B(3,1)" },
},
{
from: { x: 3, y: 1, z: 0, label: "B(3,1)" },
to: { x: -3, y: -1, z: 0, label: "C(-3,-1)" },
},
{
from: { x: -3, y: -1, z: 0, label: "C(-3,-1)" },
to: { x: -2, y: 4, z: 0, label: "A(-2,4)" },
},
].map((segment) => ({
points: [segment.from, segment.to],
color: getColor("AMBER"),
showPoints: true,
labels: [{ text: segment.from.label, at: 0, offset: [0.4, 0.4, 0] }],
})),
// Triangle A'B'C' (Image)
...[
{
from: { x: 4, y: -2, z: 0, label: "A'(4,-2)" },
to: { x: 1, y: 3, z: 0, label: "B'(1,3)" },
},
{
from: { x: 1, y: 3, z: 0, label: "B'(1,3)" },
to: { x: -1, y: -3, z: 0, label: "C'(-1,-3)" },
},
{
from: { x: -1, y: -3, z: 0, label: "C'(-1,-3)" },
to: { x: 4, y: -2, z: 0, label: "A'(4,-2)" },
},
].map((segment) => ({
points: [segment.from, segment.to],
color: getColor("TEAL"),
showPoints: true,
labels: [{ text: segment.from.label, at: 0, offset: [0.4, 0.4, 0] }],
})),
]
- showZAxis: false
- cameraPosition: [0, 0, 18]

## Reflecting a Line Equation

If a line has the equation $$y = 2x + 3$$ is reflected over the line $$y=x$$, determine the equation of its image.

Visible text: If a line has the equation is reflected over the line , determine the equation of its image.

To find the equation of the image, we use the rule <InlineMath math="x' = y" /> and <InlineMath math="y' = x" />. This means we replace every $$x$$ in the original equation with $$y$$ (or <InlineMath math="y'" />) and every $$y$$ with $$x$$ (or <InlineMath math="x'" />).

Visible text: To find the equation of the image, we use the rule <InlineMath math="x' = y" /> and <InlineMath math="y' = x" />. This means we replace every in the original equation with (or <InlineMath math="y'" />) and every with (or <InlineMath math="x'" />).

Original equation:

```math
y = 2x + 3
```

Substitute $$x \rightarrow y$$ and $$y \rightarrow x$$ (using $$x$$ and $$y$$ for the new variables for simplicity):

Visible text: Substitute and (using and for the new variables for simplicity):

```math
x = 2y + 3
```

This is the equation of the image line. Usually, we rewrite this equation in the form $$y$$ as a function of $$x$$:

Visible text: This is the equation of the image line. Usually, we rewrite this equation in the form as a function of :

Component: MathContainer
Children:

```math
x - 3 = 2y
```

```math
y = \frac{1}{2}x - \frac{3}{2}
```

So, the equation of the image of the line $$y = 2x + 3$$ after reflection over $$y=x$$ is $$y = \frac{1}{2}x - \frac{3}{2}$$.

Visible text: So, the equation of the image of the line after reflection over is .

Component: LineEquation
Props:
- title: Line $$y=2x+3$$ and its Image over{" "}
$$y=x$$
  Visible text: Line and its Image over{" "}
- description: Reflection of the line $$y=2x+3$$ over the line{" "}
$$y=x$$.
  Visible text: Reflection of the line over the line{" "}
.
- data: [
{
points: [
{ x: -7, y: -7, z: 0 },
{ x: 7, y: 7, z: 0 },
],
color: getColor("INDIGO"),
labels: [{ text: "y=x", at: 1, offset: [0.5, -0.5, 0] }],
}, // Reflection line
{
// Original Line y = 2x + 3
points: Array.from({ length: 11 }, (_, i) => {
const xVal = i - 5;
return { x: xVal, y: 2 * xVal + 3, z: 0 };
}),
color: getColor("PURPLE"),
smooth: true,
labels: [{ text: "y=2x+3", at: 4, offset: [-1, 0.5, 0] }],
},
{
// Image Line y = (1/2)x - 3/2
points: Array.from({ length: 11 }, (_, i) => {
const xVal = i - 5;
return { x: xVal, y: (1 / 2) * xVal - 3 / 2, z: 0 };
}),
color: getColor("PINK"),
smooth: true,
labels: [{ text: "y=(1/2)x-3/2", at: 9, offset: [0.5, -1, 0] }],
},
]
- showZAxis: false
- cameraPosition: [0, 0, 18]

## Exercises

1.  Determine the coordinates of the image of point $$M(-4, 7)$$ if it is reflected over the line $$y = x$$!
2.  Determine the image of triangle $$ABC$$ with vertices $$A(1, -2)$$, $$B(2, 3)$$, and $$C(-2, 0)$$ reflected over the line $$y = x$$.
3.  If a line has the equation $$y = -3x + 5$$ is reflected over the line $$y = x$$, determine the equation of its image.

Visible text: 1. Determine the coordinates of the image of point if it is reflected over the line !
2. Determine the image of triangle with vertices , , and reflected over the line .
3. If a line has the equation is reflected over the line , determine the equation of its image.

### Key Answers

1.  The image of point $$M(-4, 7)$$ is <InlineMath math="M'(7, -4)" />.

    **Explanation:** The $$x$$ and $$y$$ coordinates are swapped: <InlineMath math="x' = 7" />, <InlineMath math="y' = -4" />.

2.  The coordinates of the image triangle <InlineMath math="A'B'C'" /> are:

    - <InlineMath math="A'(-2, 1)" /> (from $$A(1, -2)$$)
    - <InlineMath math="B'(3, 2)" /> (from $$B(2, 3)$$)
    - <InlineMath math="C'(0, -2)" /> (from $$C(-2, 0)$$)

3.  The equation of the image of the line $$y = -3x + 5$$ is $$x = -3y + 5$$.

    **Explanation:** Substitute $$x \rightarrow y$$ and $$y \rightarrow x$$ into the original equation:

    
    
    ```math
    x = -3y + 5
    ```

    If converted to the form $$y = mx+c$$:

    <MathContainer>
      
    
    ```math
    3y = -x + 5
    ```

      
    
    ```math
    y = -\frac{1}{3}x + \frac{5}{3}
    ```

    </MathContainer>

Visible text: 1. The image of point is <InlineMath math="M'(7, -4)" />.

 **Explanation:** The and coordinates are swapped: <InlineMath math="x' = 7" />, <InlineMath math="y' = -4" />.

2. The coordinates of the image triangle <InlineMath math="A'B'C'" /> are:

 - <InlineMath math="A'(-2, 1)" /> (from )
 - <InlineMath math="B'(3, 2)" /> (from )
 - <InlineMath math="C'(0, -2)" /> (from )

3. The equation of the image of the line is .

 **Explanation:** Substitute and into the original equation:

 
 

 If converted to the form :

 <MathContainer>
 
 

 
 

 </MathContainer>