# How to Reflect a Coordinate Shape Over the X-Axis, Y-Axis, or Diagonal

Using Cartesian coordinates to plot shapes and diagrams has many advantages over other methods of graphing and drawing two-dimensional and three-dimensional objects. When you know an object by its coordinates you can easily calculate distances, volumes, areas, and perimeters. Another useful feature of coordinates is that they make it easy to draw the reflection of a flat shape over a given line in the two-dimensional plane. Three of the most common reflectional symmetries are created by mirroring an object over the x-axis, y-axis, and diagonal line y = x. To reflect an object over one of these three axis requires only a simple transformation of the original coordinates.

## Reflecting Over the X-Axis

To produce the reflection of a shape over the horizontal axis, aka the x-axis, you keep the x-coordinates of the points the same while reversing the signs of the y-coordinates. If the coordinates of a shape are given by the points

(x1, y1), (x2, y2), (x3, y3), ..., (xn, yn)

then the coordinates of the reflection are

(x1, -y1), (x2, -y2), (x3, -y3), ..., (xn, -yn)

For example, consider the triangle with Cartesian coordinates (3, 1), (5, 4), and (7, 2). The coordinates of this triangle's reflection over the x-axis are (3, -1), (5, -4), and (7, -2). This is shown in the following graph with the original triangle in red and its reflection in green.

## Reflecting Over the Y-Axis

To produce the reflection of a shape over the vertical axis, aka the y-axis, you keep the y-coordinates of the points the same while reversing the signs of the x-coordinates. If the coordinates of a shape are given by the points

(x1, y1), (x2, y2), (x3, y3), ..., (xn, yn)

then the coordinates of the reflection are

(-x1, y1), (-x2, y2), (-x3, y3), ..., (-xn, yn)

For example, consider the triangle with Cartesian coordinates (3, 1), (5, 4), and (7, 2). The coordinates of this triangle's reflection over the y-axis are (-3, 1), (-5, 4), and (-7, 2). This is shown in the figure below with the original triangle in red, and its mirror image in green.

## Reflecting Over the Line y = x

The line y = x is the diagonal line that cuts the Cartesian plane in half at a 45-degree angle. To reflect a shape over this line of symmetry, you reverse the places of the x- and y-coordinates of every point on your shape. In other words, if the coordinates of the shape are

(x1, y1), (x2, y2), (x3, y3), ..., (xn, yn)

then the reflected shape's coordinates are

(y1, x1), (y2, x2), (y3, x3), ..., (yn, xn)

For example, consider once more the triangle whose coordinate points are (3, 1), (5, 4), and (7, 2). When you reflect this shape over the diagonal line y = x it has the new coordinates (1, 3), (4, 5), and (2, 7). This is illustrated below with the original triangle in red and its diagonal reflection in green.

## More Practice Problems

Practice your Cartesian mirroring skills by reflecting these shapes over the given axis.

(1) Reflect the square bounded by points (6, 1), (8, 0), (9, 2), and (7, 3) over the line y = x.

(2) Reflect the triangle bounded by (0, 0), (8, 0), and (4, 7) over the y-axis.

(3) Reflect the rectangle bounded by (-9, 2), (-13, 2), (-9, 5), (-13, 5) over the x-axis.

## Advanced Algebra

The technique of reflection applies not only to polygons defined by a set of coordinates, but also to functions of the form y = f(x). Here are the three rules for reflecting arbitrary curves.

- The reflection of f(x) over the x-axis is the function -f(x).
- The reflection of f(x) over the y-axis is the function f(-x).
- The reflection of y = f(x) over the line y = x is the inverse function given by x = f(y).

## Reflecting a Point of Shape Over Any Line

The methods for flipping a point or collection of points over the x-axis, y-axis, or diagonal line are easy because the coordinate transformations are simple. But there are also formulas for reflecting points over arbitrary lines.

Suppose you have the point (a, b) and the axis of symmetry line y = mx + k. The reflection of (a, b) over the line y = mx + k is given by the following coordinates:

new x-coordinate = (a + 2bm - 2km - am^2)/(m^2 + 1)

new y-coordinate = (2am - b + bm^2)/(m^2 + 1)

For example, suppose we wish to reflect the point (-8, 17) over the line y = 7x + 23. Here we have a = -8, b = 17, m = 7, and k = 23. Plugging these four values into the x-coordinate and y-coordinate expressions above, the coordinates of the reflection are:

new x-coordinate = (-8 + 238 - 322 + 392)/50 = 6

new y-coordinate = (-112 - 17 + 833)/50 = 14.08

So the reflected point is at (6, 14.08).

## Comments

How do I keep shape in the same position but make its area four times greater?

Reflect the square {(0,0) (1, 1) (0, 2) (-1, 1)} over the line y = (1/2)x + 3?

how do you rotate a shape around the origin by a given angle theta? I can do it for 90 and 180 degrees easily in my head but what is the general formula?

5