Source: https://www.lamsade.dauphine.fr/~giard/UE_305_Informatique_et_CG.pdf