Source: https://docplayer.fr/21584945-Fonctions-affines-par-morceaux.html.pdf