http://www.les-mathematiques.net/phorum/read.php?2,63655
https://mathworld.wolfram.com/LeastSquaresFittingPerpendicularOffsets.html