Find eccentricity of orbit knowing comet speed and position

1. The problem statement, all variables and given/known data
A comet has speed v when it is a distance r from the Sun. Its direction of motion makes an angle φ with the radius vector from the Sun. Find the eccentricity of the comet’s orbit.

2. Relevant equations
$$v^2 = G M \left( \frac{2}{r} - \frac{1}{a} \right)$$

3. The attempt at a solution
Not really sure where to start... help!
Thanks.
 PhysOrg.com science news on PhysOrg.com >> King Richard III found in 'untidy lozenge-shaped grave'>> Google Drive sports new view and scan enhancements>> Researcher admits mistakes in stem cell study