To derive the formula for gradient, we consider any right-
angled triangle formed fromA(x 1 ;y 1 )andB(x 2 ;y 2 )with
hypotenuseABas shown in the diagram alongside. The gra-
dient is determined by the ratio of the length of the vertical
side of the triangle to the length of the horizontal side of the
triangle. The length of the vertical side of the triangle is the
difference iny-values of pointsAandB. The length of the
horizontal side of the triangle is the difference inx-values of
pointsAandB.