Source: https://webusers.imj-prg.fr/~emmanuel.lepage/TD/GeoAlg/TD1.pdf