Calculating Kinetic Energy and Potential Energy