Elevation rotation of a matrix in polar-coordinates Disclaimer: I don't seem to be able to wrap my mind around this, because MAYBE the program I'm using to visualize 3D Data performs some kind of transformation I'm not aware of, therefore produces results that are not conform to what I would expect.
I have a 3D antenna pattern, which is described by a 2D matrix of 181 x 360 points (one every 1° for each dimension). Let phi be the plane with 360 points (0° to 359°) associated to the azimuth angle, and theta the one with 181 (0° to 180°) points associated to the elevation angle. R would instead be the value of the matrix by the coordinates phi and theta.
Since we move on a spherical surface, the point phi = x and theta = 180° + y is equal to phi = x + 180° and theta = 360° - (180° + y).
Now, suppose I have to rotate the 3D pattern by an elevation of delta degrees.
Strictly reasoning on the matrix, which is the transformation I would have to perform? I tried:


*

*Building the 360 x 360 matrix (with the "rule" mentioned above), then selecting a 181 x 360 matrix, whose first element is the delta-th element of the original matrix.

*Splitting the 181 x 360 matrix in four 181 x 90 matrices, which are shifted in different directions, and whose missing elements (all the data which would be shifted before the first index or after the 181th index) are taken from the "displaced" elements from other matrices (e.g.: Matrix1 shifts 20 positions up, therefore 20 positions by the end indexes become nulls. Matrix2 shifts 20 positions down, therefore Matrix1 inherits the "downward-displaced" data from Matrix2 and Matrix2 the "upward-displaced" one from Matrix1.
What is the correct transformation?
EDIT: I don't seem to have found a flaw yet in splitting the matrix in 4 columns and rotate them. Even if I do that, though, the 3D picture doesn't look good. Am I not considering something here?
 A: Let us try to find a common reference system first. (I would usually do this in the comments, but I need an image here)

The spherical coordinates used in physics are
\begin{align}
x &= r \cos \phi \sin \theta \\
y &= r \sin \phi \sin \theta \\
z &= r \cos \theta
\end{align}
where $\phi \in [0, 2\pi)$ is the azimuthal angle and $\theta\in[0,\pi)$ the polar angle.
How do these relate to your angles?
E.g. do you use $\theta' = \pi/2 - \theta$ for $\theta' \ge 0$ as elevation?
A: Performing an "elevation rotation" by simple array element shifting is impossible (whereas an "azimuth rotation" is trivial*).
If you have no other choice, you need to resort to resampling by interpolation.


*

*compute the rotation matrix from the direction of the (horizontal) axis of rotation and the rotation amplitude; you can use the Rodrigues formulas;

*scan the desired $\phi, \theta$ points, convert them to Cartesian coordinates and apply the rotation;

*obtain the new $\phi, \theta$ angles in the unrotated axis by converting back to spherical coordinates;

*from these angles, determine the tile you are in (by rounding the angles);

*estimate the value between the four tile corners, by bilinear interpolation (if better accuracy is requested, think of bicubic).
It is likely that the steps 2-3 can be performed directly using spherical trigonometry, without converting to Cartesian coordinates, but this is well above my head.

*If changing the original coordinate system is an option, let Z be the desired rotation axis and perform an azimuthal rotation.
