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