About rotation xyz axis

I have a question. I want to rotate the object. I want to create an algorithm that changes the z-value while rotating in the xy plane. The reason why I want to do this is to know the rotation angle of the product. Please help me.

캡처2

What is your question?

If the question is related with the sun and panels of some sort … then is a bit more complicated (if you want accurate regional [per location alt/long] data for the sun alt/az angles [critical for large scale projects and brake even simulations blah, blah]). I have various things that do that but are 100% C# . See a simple abstract demo in 2 modes (shadows or object orientation [perp to sun dir - kinda a pivoting collector]).