You have not said what solution you seek.
A parallel line through the point will have the same slope, but a different intercept. The new intercept (b') will satisfy the equation
y = x + b'
-7 = 2 + b' substitute the values at the given point
-9 = b' subtract 2
Your equation is y = x - 9.
A perpendicular line through the point will have a slope (m') that is the negative inverse of the slope of your line, which is 1.
-1/1 = m' = -1
So the perpendicular line will have the form
y = -x + b' where b' is the intercept that makes the line go through the given point
-7 = -(2) + b' substitute the values at the given point
-5 = b' add 2
Your equation is y = -x - 5.
The distance from the point to the line is
d = |y - x + 2|/√(1^2 + (-1)^2) = |-7 - 2 + 2|/√2 = (7/2)√2
A parallel line through the point will have the same slope, but a different intercept. The new intercept (b') will satisfy the equation
y = x + b'
-7 = 2 + b' substitute the values at the given point
-9 = b' subtract 2
Your equation is y = x - 9.
A perpendicular line through the point will have a slope (m') that is the negative inverse of the slope of your line, which is 1.
-1/1 = m' = -1
So the perpendicular line will have the form
y = -x + b' where b' is the intercept that makes the line go through the given point
-7 = -(2) + b' substitute the values at the given point
-5 = b' add 2
Your equation is y = -x - 5.
The distance from the point to the line is
d = |y - x + 2|/√(1^2 + (-1)^2) = |-7 - 2 + 2|/√2 = (7/2)√2