Source: https://maths.ac-creteil.fr/IMG/pdf/fonctions_loc6ee.pdf