We present the fundamentals of geometrothermodynamics, an approach to study
the properties of thermodynamic systems in terms of differential geometric
concepts. It is based, on the one hand, upon the well-known contact structure
of the thermodynamic phase space and, on the other hand, on the metric
structure of the space of thermodynamic equilibrium states. In order to make
these two structures compatible we introduce a Legendre invariant set of
metrics in the phase space, and demand that their pullback generates metrics on
the space of equilibrium states. We show that Weinhold's metric, which was
introduced {\it ad hoc}, is not contained within this invariant set. We propose
alternative metrics which allow us to redefine the concept of thermodynamic
length in an invariant manner and to study phase transitions in terms of
curvature singularities.Comment: Revised version, to be published in Jour. Math. Phy