I was writing a C++ class for working with 3D vectors. I have written operations in the Cartesian coordinates easily, but I'm stuck and very confused at spherical coordinates. I googled my question but couldn't find a direct formula for vector product in the search results.
Assume that I have $ \overrightarrow{V_1} $ and $ \overrightarrow{V_2} $ vectors in shperical coordinates:
$ \overrightarrow{V_1} = r_1\hat{u_r} + \theta_1\hat{u_\theta} + \phi_1\hat{u_\phi} \\ \overrightarrow{V_2} = r_2\hat{u_r} + \theta_2\hat{u_\theta} + \phi_2\hat{u_\phi} \\ \hat{u_r}: \mbox{the unit vector in the direction of radius} \\ \hat{u_\theta}: \mbox{the unit vector in the direction of azimuthal angle} \\ \hat{u_\phi}: \mbox{the unit vector in the direction of polar angle} $
$ \theta $ and $ \phi $ angles are as represented in the image below:
What is the general formula for taking dot and cross products of these vectors?
$ \overrightarrow{V_1} \bullet \overrightarrow{V_2} = ? \\ \overrightarrow{V_1} \times \overrightarrow{V_2} = ? $
If you need an example, please work on this one:
$ \overrightarrow{V_1} = 2\hat{u_r} + \frac{\pi}{3}\hat{u_\theta} + \frac{\pi}{4}\hat{u_\phi} \\ \overrightarrow{V_2} = 3\hat{u_r} + \frac{\pi}{6}\hat{u_\theta} + \frac{\pi}{2}\hat{u_\phi} $