Hey,
I was wondering if there is an easy way to convert the basis of a vector from spherical coordiantes to Cartesian coordinates. Here is what I mean:
Vector in spherical coordinates,
v=a er + b eth + c eph
(e_ are the unit vectors)
I only want to change the basis to cartesian, so it would look something like
v=(a*cos(ph)*sin(th)+b*cos(ph)*cos(th)-c*sin(ph)) i + (a*sin(th)*sin(ph) + b*cos(th)*sin(ph) + c*cos(ph)) j + (-b*sin(th)+a*cos(th)) k
I looked at CoordinateTransform function which transforms the given point in a given coordinate system to another system, but this is not exactly what I am looking for. The closest I found in VectorCalculus package was TransformedField function with the following call
TransformedField["Spherical"->"Cartesian", {a,b,c}, {r,th,ph}->{x,y,z}]
This works fine, but it also transforms the components.
So, is there any function, like TransformedField, which gives me
v={a*cos(ph)*sin(th)+b*cos(ph)*cos(th)-c*sin(ph), (a*sin(th)*sin(ph) + b*cos(th)*sin(ph), c*cos(ph)) j + (-b*sin(th)+a*cos(th)}
?
Technically, I could multiply it with an appropriate matrix to get what I need, but it would be nice to have a function like the one above.
Thanks in advance.