If you subtract the camera position from the player’s position, the result is a vector indicating the direction camera->player, and its magnitude will be the distance between their pivots (positions). Supposing cam and player are variables containing the camera and player transforms:
var vCam:Vector3 = player.position - cam.position; // vector camera->player
var dist:float = vCam.magnitude; // distance between camera and player
Or, if you want to get a position at dist distance from the player, and rotated V degrees in the vertical plane and H degrees in the horizontal plane, you can do:
This rotates Vector3.forward V and H degrees as specified above, and place the camera at the distance dist in that direction.
NOTE: depending on the reference you have, you may find the V angle going in the opposite direction; if it happens, use -V instead. The same applies to the H angle - if you expect it to go clockwise, but it goes counter-clockwise, use -H.