Formula
Let R be the radius of the bounding sphere for your object.
Let V be the vertical field of view angle, 0 < V < 90 degrees.
Let H be the horizontal field of view angle, 0 < H < 90 degrees.
Then the distance you need to place your camera from the object is Z = R / sin(min(V,H)).
Derivation
Here is what the derivation is for the distance Z needed for a full vertical view of the object. Solve for Z to get Z = R / sin(V).
A similar derivation for the distance Z needed for a full horizontal view gives Z = R / sin(H). Since we want both a full vertical and horizontal view, we use Z = max(R / sin(V), R / sin(H)) = R / sin(min(V,H)).