If I project a cube's corner on a plane by photographing it from a distance I get three lines radiating from a point. From two angles $A$, $B$ made by these three lines in the plane, I should be able to calculate the viewing angles relative to the cube's ($\mathbf{\hat{x}}$, $\mathbf{\hat{y}}$, $\mathbf{\hat{z}}$) axes in spherical coordinages.
I should be able to, but I can't right now. I need a helpful hint how to do this projection without going too deep into projective geometry
I'm just asking about the simple math problem here; photogrammetry is a whole topic unto itself.
Cropped from 17-Oct-2018 NASA ICE tweet, (sadly, the dimensions are not in the ratio 1:4:9)


Well, I gave it a shot but couldn't come up with an easy way to solve the equation for $\phi$ except guess and check. Someone more knowledgeable may know. Edit: Someone helped me with the equation (thanks Yves) so it's now easier to solve for $\phi$.
I've added some further explanation. I should clarify that angles A,A',B, B' are all on the top surface of the cube between the z axis projected onto the $xy$ plane, and the $x$ and $y$ axes. We are trying to determine the polar coordinates of the line of view which includes two angles. These are, the angle the line of sight makes with the positive $x$ axis (angle $A$ can be used to determine $\theta$) and the angle the line of sight makes with the $z$ axis (angle $\phi$). I've projected a true view of the top surface and shown how the two dark triangles, co-planar with the top surface of the cube, have been elongated along their adjacent sides from $a1$ to $a2$. Angle $\phi$ is the angle the top surface is tilted through to become a true view. Sorry about the projection lines not matching up I couldn't get it all on one image.