Hamilton invented what is now known as the Hamiltonian formulation of Newtonian mechanics. In doing so, he discovered that there is a very close analogy between Newtonian mechanics and geometrical (ray) optics. He also invented quaternions in mathematics and found a number of applications of quaternions in physics.