Given two points (x1, y1) and (x2, y2), the slope of the line from both points is calculated as follows:
The distance between the points, or the length of the segment that joins both points is given by:
The coordinates of the midpoint between the given points are: