An interesting analogy between inertial and electromagnetic forces has been presented recently. It was shown that centrifugal and Coriolis forces found in a non-inertial rotating frame can be simulated by electrostatic and magnetic forces. The authors develop the analogy in the formalism of Lagrange and Hamilton, and discuss two physical examples.