Describing thermodynamics in analogy with mechanics

Legendre transforms

Contact geometry

Further reading