To calculate the slope of a line, you only need two points from that line, (x1, y1) and (x2, y2).
The equation used to calculate the slope from two points is:
(y2 - y1) / (x2 - x1)
#1:
First point : (5 ,7) = (x1, y1)
Second point : (2, -2) = (x2, y2)
Equation : (-2 - 7) / (2 - 5)
Solve the equation:
(-2 - 7) = -9
(2 - 5) = -3
-9/-3 = 3 (a negative number divided by a negative number gives you a positive number)
The slope of the line in #1 is : 3
#3:
First point : (5, 9) = (x1, y1)
Second point : (5, -2) = (x2, y2)
Equation : (-2 - 9) / (5 - 5)
Solve the equation:
In this case, you don't need to solve anything, because anything divided by zero will give you 0 (5 minus 5 = 0).
The slope of the line in #3 is : 0