Given two points (x1, y1) and (x2, y2), the slope of the line from both points is calculated as follows:
[tex]m=\frac{y_2-y_1}{x_2-x_1}[/tex]The distance between the points, or the length of the segment that joins both points is given by:
[tex]D=L=\sqrt[]{(x_2-x_1)^2+(y_2-y_1)^2}[/tex]The coordinates of the midpoint between the given points are:
[tex]\mleft(\frac{x_1+x_2}{2},\frac{y_1+y_2}{2}\mright)[/tex]