The gradient (or slope) of a line between two points is calculated using the change in y-coordinates divided by the change in x-coordinates. The distance between two points is found using the distance formula, which is the square root of the sum of the squares of the differences in x-coordinates and y-coordinates.