The slope of a line is calculated using the formula:
slope = (Y2 - Y1) / (X2 - X1)
Example 1:
Points: (1, 2) and (3, 4)
Slope: 1
Example 2:
Points: (0, 0) and (5, 10)
Slope: 2
Example 3:
Points: (-2, 3) and (2, 3)
Slope: 0