Least Squares Criterion
Use the red points to change the slope and y-intercept of the line. Then minimize the total area of the squares.
Information: Least Squares Criterion