Calculate projectile angle

This is not really related to Box2D but here goes..

Im making a cannon game, and im trying to figure out how i can make the enemy fire at the position of the body of the player.
So i have the coordinates but i need to figure out the angle and maybe velocity so the enemy can fire the projectile correctly at the player.
I found this formula: http://en.wikipedia.org/wiki/Trajectory_of_a_projectile but i have no idea how to implement it!

Any ideas?
Thanks
Use Math.atan2(dy, dx) to find the angle. Then use cos and sin to set the velocity.

Original thread: https://box2d.org/forum/viewtopic.php?t=3703