
William W. answered 05/08/20
Experienced Tutor and Retired Engineer
The slope ("m") of a line between 2 points is calculated by this equation:
where the two points are (x1, y1) and (x2, y2) [the first point has "1" subscripts and the second point has "2" subscripts to identify which is which).
In other words, you subtract the two y-values, subtract the two x-values, then divide them. Just make sure to keep them in order (whichever point you start with, keep it first for both "x" and "y")
Example: For the first two points (16, 5) and (16, 15) let's let the first point be (16, 5). That means x1 = 16 and y1 = 5. By default, the other point is point 2 so x2 = 16 and y2 = 15. So:
m = (y2 - y1)/(x2 - x1)
m = (15 - 5)/(16 - 16) = 10/0
Bad first example. The slope is "undefined" because in math, division by zero is not defined.
Example:(4, 11) and (-12 , -1)
m = (y2 - y1)/(x2 - x1)
m = (-1 - 11)/(-12 - 4) = -12/-16 = 12/16 = 3/4 so the slope is 3/4