Source: http://ww2.ac-poitiers.fr/math/sites/math/IMG/pdf/19_20_sde_dm_fcts_carre_heron.pdf