Following this and this questions, I want to solve the system of nonlinear trigonometrical equations (as part of an inverse kinematics calculation):
$$\begin{align} \sin{\phi} \sin{\gamma} &= \sin\alpha \cos\theta_1 \cos\theta_2 + \cos\alpha \sin\theta_2\\ \cos{\phi} &= \cos\alpha \cos\theta_1 \cos\theta_2 - \sin\alpha \sin\theta_2 \\ \sin\phi \cos\gamma &= \sin\theta_1 \cos\theta_2 \end{align}$$
for $\theta_1$ and $\theta_2$ given the $\gamma$, $\phi$, and $\alpha$.
I think there should be closed form solution.
I tried Python-SymPy:
from sympy.solvers import solve
from sympy import symbols, sin, cos, tan
alpha, gamma, phi, theta1, theta2 = symbols('alpha gamma phi theta_1 theta_2')
eqs = (sin(alpha) * cos(theta1) + tan(theta2) * cos(alpha) - tan(gamma) * sin(theta1),
cos(alpha) * cos(theta1) * cos(theta2) - sin(alpha) * sin(theta2) - cos(phi))
solve(eqs, (theta1, theta2))
However, the interpreter never finishes.
I would appreciate if you could help me know if the above system of equations has explicit solution.
(too long for comment)
The Euler angles define the position of a 3D Euclidean reference system rotated wrt a base one.
The spherical coordinates define the position of one (unit vector), for instance the $x'$ axis of the rotated system: the position of the other two (rotation around $x'$) is not known.
So the correspondence is not univoque. You shall specify better what actually is your aim.
I saw now that you mention Rodrigues' formula: that is in fact relative to the rotation of a (unit) vector around another unit vector (axis of rotation). Practically the rotation of a point on earth around another point on earth. So how is your problem formulated in this "environment" ?
From your self-answer, and taking as reference the Geographic convention for Spherical Coordinates with $\theta_1$ as longitude and $\theta_2$ as latitude, it is now clear that you want to
- take a vector in such a reference system $$ {\bf v} =\left( {1,\theta _1 ,\theta _2 } \right) = \left( {\matrix{ {\cos \theta _2 \cos \theta _1 } \cr {\cos \theta _2 \sin \theta _1 } \cr {\sin \theta _2 } \cr } } \right) $$ - exchange its components according to the matrix $$ {\bf E} = \left( {\matrix{ 0 & 0 & 1 \cr 1 & 0 & 0 \cr 0 & 1 & 0 \cr } } \right) $$ which has a negative determinant and so includes a reflection;
- rotate it around the original reference polar axis ($z$) of an angle $- \alpha$ (in the right-hand convention, i.e. eastward) $$ {\bf R}_{\,{\bf z}} ( - \alpha ) = \left( {\matrix{ {\cos \alpha } & { + \sin \alpha } & 0 \cr { - \sin \alpha } & {\cos \alpha } & 0 \cr 0 & 0 & 1 \cr } } \right) $$ - exchange back its components $$ {\bf E}^{\, - \,{\bf 1}} = \left( {\matrix{ 0 & 1 & 0 \cr 0 & 0 & 1 \cr 1 & 0 & 0 \cr } } \right) $$ - rename the resulting longitude ${\theta '}_1$ as $\gamma$, and take the azimut angle $\phi$ in place of the resulting latitude ${\theta '}_2$ , i.e. $\phi = \pi/2-{\theta '}_2$.
Is that your goal?