calculate orientation vector

17 Views Asked by At

I have a half-sphere. On the edge of the half-sphere, there is a circular cutout.

I want to place the cube on the edge of the sphere, in the circular cutout, such that the cube is perpendicular to the circular cutout. In other words, if I were to fire a ray directly from the center of the cube, it would intersect the center/base of the half-sphere and the circular cutout. I know the radius of the half-sphere and of the circular cutout. I just need to calculate the orientation vector (xyz) for the cube. How can I get it?

Below is a top-down example.

enter image description here