Source: http://gerard.nin.free.fr/math/2014/O2M2/PythagoreCor.pdf