Source: http://math.univ-lyon1.fr/capes/IMG/pdf/triangle_rectangle_v3.pdf