Geometric Formulation of Classical and Quantum Mechanics