Explanation:
a normal mathematical reflection always works perpendicular to the line of reflection.
that means the lines between the old and the new points and the line of reflection intersect each other at 90°.
and the intersection point is the midpoint between the old and the new points.
the slope is a line is always the ratio
y coordinate difference / x coordinate difference
when going from one point on the line to another.
a perpendicular slope is then the upside-down conversion of that ratio with a flipped sign.
the typical line equation looks like
y = ax + b
"a" being the slope, "b" being the y-intercept (y-value when x = 0)
so,
midpoint M is
((-2 + 4)/2, (8 + 8)/2) = (2/2, 16/2) = (1, 8)
the slope of AB is
(8 - 8) / (4 - -2) = 0/6 = 0
so, it is a horizontal line
that makes line m a vertical line (x is constant for the whole line, so the slope is infinity).
which constant do we have to use ?
well, it has to go through the midpoint.
so, the equation is
x = 1