Duality Invariance and Riemannian Geometry