I want to rotate a function $f(\theta,\phi)$ around an arbitrary angle in 3D space. (Assuming $\phi$ is in the $xy$ plane and goes from $0$ to $2\pi$, and $\theta$ starts from $+z$ and goes from $0$ to $\pi$)
Is there an easy way to make substitutions or similar things for the angles? I know that for a vector function (with carthesian components, can be transformed), one can use rotation matrices. But I don't know a similar concept for scalars.
Rotation around $\phi$ is obviously simple (just substituting $\phi \rightarrow \phi-\alpha$ does work). However, rotation in other planes than the $xy$ plane seems to be not that easy. A simple example might be $f=\sin\theta$. If I want to rotate this function in the $yz$ plane, what can I do? Clearly, a substitution like $\theta \rightarrow \theta - \alpha$ does not do the wanted rotation.
If I assume $f(\theta,\phi)$ to be the radius of spherical points, a Cartesian location vector can be formed $\mathbf x =\begin{pmatrix}f(\theta,\phi)\sin\theta\cos\phi\\f(\theta,\phi)\sin\theta\sin\phi\\f(\theta,\phi)\cos\theta\end{pmatrix}$, to which a rotation matrix can be applied. A new rotated vector is obtained, $\mathbf x^\prime = \mathbf R \mathbf x$. Using the components of this vectors, the new angles can be determined with $\theta \rightarrow \arctan\frac{\sqrt{x^{\prime2}+y^{\prime2}}}{z^\prime}$ and $\phi \rightarrow \arctan\frac{y^\prime}{x^\prime}$.
Knowing $f(\theta,\phi)$ at some fixed points, these points can be transformed using the stated formulas. If the inverse of the rotation matrix, $\mathbf R^\mathrm T$, is used, it also works the other way round.