The Distance Formula. The shortest distance between two points is a straight line. This distance can be calculated by using the distance formula. The distance between two points (x1, y1) and (x2, y2) can be defined as d=√(x2−x1)2+(y2−y1)2.