Source: https://scil.dinf.usherbrooke.ca/static/website/courses/imn530/MorphoMath.pdf