I am struggling with a problem in the $3D$ coordinate system.
I have a point given by its coordinates (I also know the distance from the origin, so I don't have to bother with counting that) and I need to make a line segment from the origin to this point by rotating the line segment. 
**How can I get angles to rotate it?**

I suppose I need only two angles. I was trying to use some arctangent formula, but I am not able to finish it.

The best I could do was 

> 
> $angle\_1 = \arctan(\frac{x}{diag\_{xy}})$; $angle\_2 = \arctan(\frac{y}{x})$
> 
> 
> 

but that doesn't work.