Spherical coordinates w.r.t. nonstandard basis vectors

194 Views Asked by At

Linear algebra / Matlab question: in $\mathbb{R}^{3}$, let's say that I have an orthonormal basis, $\{v_{1},v_{2},v_{3}\}$, that is not the standard Euclidean basis vectors, ($e_{1}=(1,0,0)$, $e_{2}=(0,1,0)$, $e_{3}=(0,0,1)$). So, $v_{i}\bullet v_{j}=\delta_{ij}$, etc.

I would like to determine the orientation of these three vectors $v_{1},v_{2},v_{3}$ in the same sense that $e_{1},e_{2},e_{3}$ are oriented in the spherical coordinate system.

Let $V$ be the $3\times 3$ matrix whose columns are these orthonormal basis vectors; i.e., $V=[v_{1}\, \vert \, v_{2} \vert \,v_{3}]$. Using Matlab (for example), I can numerically determine the coordinates of the $v_{i}$ with respect to the standard Euclidean basis. For context, I obtain $V$ by computing the singular value decomposition of a cloud of points in $\mathbb{R}^{3}$ about a focal point that is located away from the origin. The columns of $V$, the singular vectors of this data array, constitute an orthonormal coordinate system that is localized at the focal point.

To do this, I begin by imposing that one of the $v_{i}$ "corresponds" to the Euclidean $y$-axis (e.g., to $e_{2}$, say). As an example, suppose that I choose to identify $V(:,3)=v_{3}$ with $e_{2}$ (without loss of generality). Given that the coordinates of the $v_{i}$ are fixed, having already been computed, I now want to identify/determine which of the remaining vectors $v_{1}$ and $v_{2}$ correspond to $e_{1}$ and $e_{3}$ (e.g., pointing in the direction of the positive $x$ and $z$ axes), respectively.

My idea is to compute the spherical coordinates of $v_{1}$ and $v_{2}$ relative to $v_{3}$ (the vector that has been selected to correspond to $e_{2}$). Presuming that I do this correctly, the spherical coordinates of one of the $v_{1}$ or $v_{2}$ should equal the spherical coordinates $e_{1}$, and similarly for $e_{3}$. Again, having already decreed that one of $v_{i}$ is pointing in the direction of the $y$-axis, this will be how I identify which of the remaining $v_{j}$ ($j\neq i$) corresponds to $x$ and $z$, respectively.

Of course, if the direction in which one of the $v_{i}$ is found to be pointing corresponds to the negative $x$- or $z$-axis, then I can always multiply this vector by -1 to re-orient it correctly a posteriori.

In the Matlab notation for spherical coordinates $(\theta, \phi, r)$, (used here for consistency's sake), $e_{1}=(0,0,1)$, $e_{2}=(\frac{\pi}{2},0,1)$, and $e_{3}=(0, \frac{\pi}{2},1)$. See, for example:

https://www.mathworks.com/help/phased/ug/spherical-coordinates.html

Simply converting the numerical coordinates of the $v_{i}$ directly to spherical coordinates with Matlab's $\texttt{cart2sph}$ command has not worked for me. Should there first be some sort of rotation? Am I wrong to think that my idea will work? Please help!

Essentially, I would like to compute spherical coordinates (e.g., compute $\theta$, $\phi$, and $r$) in a non-standard basis for $\mathbb{R}^{3}$. How do I do this?

1

There are 1 best solutions below

10
On

$e_2\times e_3=e_1$ and $e_2\times e_1=-e_3$. So, you could simply take the cross product of your “$y$” vector with one of the other two and compare the result to the third. If they point in the same direction, then you chose the “$z$” vector; if not, you chose the “$x$” vector.

Equivalently, toss all three into a matrix and compute its determinant. If it’s positive, then the order in which they appear in the matrix gives you a right-handed basis; if it’s negative, then the opposite order will be right-handed.

If you then want to use this as the foundation for a spherical coordinate system, the easiest thing to do, I think, is to simply convert into this coordinate system (a rotation whose matrix has the $v_i$ as rows, plus a translation), and then use the usual conversion formulas.