In my iOS app, I have a view that I'm translating on the X axis in 3D space. The anchor point for the view is in the top center. If I rotate the view M_PI degrees, it will appear to go flat. I need X pixels between the bottom of the screen and the bottom edge of the rotated view (essentially, the bottom edge's height off the ground needs to be X px). How do I calculate this percentage of M_PI?
Here's an example. In this case the view is 100px high, and I need to rotate it some percentage of M_PI such that there's 40px from the bottom edge of the screen.