Note that this isThis turns out to be a closed-form expression, which probably implies that you could have derived it yourself. But it's probably better, and definitely easier, to rely on the prowess of the good people at Wolfram instead.
Note the use of the two-argument form of ArcTan
in the result for θ
, which implies that you would have to be careful about quadrant issues if you were to write this yourself.
To apply this to a list of variables, define a function μθ[{x_, y_}]
that calls CoordinateTransformation
:
μθ[{x_, y_}] = Drop[CoordinateTransform["Cartesian" -> {{"EllipticCylindrical", 1}}, {x, y, 0}], -1]
table = Flatten[Table[{x, y}, {x, -1, 1, 1.0}, {y, -1, 1, 1.0}], 1]
μθ /@ table
(* {{-1., -1.}, {-1., 0.}, {-1., 1.}, {0., -1.}, {0., 0.}, {0., 1.},
{1., -1.}, {1., 0.}, {1., 1.}} *)
(* {{1.06128, -2.23704}, {0., 3.14159}, {1.06128, 2.23704}, {0.881374, -1.5708},
{0., Indeterminate}, {0.881374, 1.5708}, {1.06128, -0.904557}, {0., 0.},
{1.06128, 0.904557}} *)
Note that since elliptic cylindrical coordinates are ill-defined for $y = 0$ and $|x| \leq 1$, applying this transformation to the point {0,0}
leads to a result of Indeterminate
.