The midpoint formula explains the average endpoints of lines. The very first term in the method amounts x1 as well as x2. After dividing that sum by 2. The 2nd…