I would suggest graphing the line y=x+4 and y=2. You should be able to identify two points in which these two lines are 4 away from each other (I’ll give you a hint, think perpendicular). Also notice these points satisfy the form of (k,2).
From this point what you do depends on what class your taking, I’ll put the methods in order of likeliness of what class I suspect you are in:
The algebraic approach:
1) You are given the line y =x+4
2) Since our points will be on perpendicular lines, their equation will be in the form of y = -x +b with the point (k,2). Plug this point in and we get b = 2 +k. Plug b back into our equation of the perpendicular line and we get y = -x +2 + k.
3) We now have two lines, y = x +4 and y = -x +2 +k. We want to find the point at which they intersect each other so we can use the distance formula. So we set them equal to each other: x +4 = -x +2 +k, lots of algebra later this gives us x = k/2 -1. Plug this into either equation more algebra yields y = k/2 +3. So we have the point where the lines intersect: (k/2 -1, k/2 + 3)
4) We have two points now (one is where the lines intersect, the other is 2 above the x-axis), so we can use the distance formula: 4 = ( (k/2 – 1 – k)^2 – (k/2 + 3 – 2)^2 )^1/2. Algebraic simplification should give you your answer.
The geometric approach: Draw your perpendicular lines. Label the distances you know (two lines with length 4), all angels are 90 and 45 degree (remember a slope of 1/1 and -1/1 is 45 degrees). Using SAS, ASA, and the properties of 90 45 45 triangles you can get the y intercept of the perpendicular lines and then it’s merely plugging in values.
Trig: Use the law of sines and the 90 and 45 degree angels to calculate the y-intercept of the perpendicular lines.
Precalc: Pick any of the above methods.