This is for a small web library I'm working on, presenting images as a 3D carousel rotating around a y-axis. Here's a quick demo of what I have.
Unfortunately, that's not quite what I want. If they're all the same size it works fine, but if any of them are inconsistent (which will usually be the case), then they protrude or recede depending on their relative size.
I don't know if the problem is in my math or my implementation of it, so I'm hoping someone can either explain where I went wrong or suggest a better method.
Here's how I worked out the radius at which they're displayed. I'm also not 100% sure if I correctly calculated the required angle (theta):

Any correction/suggestion would be duly appreciated!
Too long for a comment, but…
You won’t be able to have both the same perpendicular distance from the centre of the circle to each image (of varying widths) and have all the images on the edges of a concyclic polygon.
Instead you could consider arranging it so that all the varying polygon edges are tangent to an inscribed circle.