Source: https://lphe.epfl.ch/bay/cours/manips/TP-06_corrige.pdf