to #1:

The locus consists of 2 parallels to the given line with a distance of 4.

The equation of the given line is:

Now use the formula to calculate the distance of a point P(s, t) to a straight line:

The distance of point P(x, y) to the given line is therefore:

to #2

The locus is the perpendicular bisector of the line segment AB.

Let P have the coordinates (x, y). Calculate the distance AP and the distance BP. Both must be equal. Solve for y.