Everything is described in the doc string... distance from the points to the line is calculated, which is done by calculating the distance of lines going through the individual points and are parallel to the estimated line.