# inappropriate domain restriction on FromPolarCoordinates?

The only way I can understand the domain restriction on FromPolarCoordinates is as ensuring a round-trip is possible: FromPolarCoordinates@ToPolarCoordinates@{x, y}. This is nice symbolically but cripples the function. Am I overlooking another justification for this choice? Shouldn't there at least be a Domain->All option?

I am not asking how to write my own.

• What, exactly, is your question? Commented Aug 23, 2016 at 23:55
• @DavidG.Stork "Am I overlooking another justification for this choice? Shouldn't there at least be a Domain->All option?"
– Alan
Commented Aug 24, 2016 at 1:03
• @Alan David probably refers to the lack of background/example of unexpected domain restriction you are talking about. While the question is there, it is not clear.
– Kuba
Commented Aug 25, 2016 at 21:27

Clearly it is trivial to implement an equivalent without the domain restriction, e.g.

frompolarcoordinates[r_, θ_] = FromPolarCoordinates[{r, θ}]


I suggest that defining your own function in this way is more convenient than burdening the built-in function with an option controlling its behaviour.

If you did want a function that checked the numerical range of its input, that would be a little more work, so be glad that Wolfram has taken the trouble to write it for you. FromPolarCoordinates can give useful warnings if, for example, you make an error in implementing numerical integration in spherical polar coordinates.

As a trivial example, an error in which the order of the arguments is exchanged is much more likely to show up if the argument domain is checked. (This type of error is probably much more likely in 3D than 2D).

• Can you elaborate on that last point? And, shouldn't loosening the domain restriction be an option (or, the behavior reversed from that, with a restriction being an option)?
– Alan
Commented Aug 25, 2016 at 21:01

This is covered in the documentation itself under the Properties & Relations section:

FromPolarCoordinates checks that inputs obey the normal restrictions of polar coordinates:

In[1]:= FromPolarCoordinates[{1, 3 Pi}]

In[1]:= FromPolarCoordinates::bdpt: Evaluation point {1,3 π} is not a
valid set of polar or hyperspherical coordinates.

Out[1]= FromPolarCoordinates[{1, 3 π}]


This point violates the condition on the angle θ:

In[2]:= CoordinateChartData["Polar", "CoordinateRangeAssumptions", {r, θ}]

Out[2]= r > 0 && -π < θ <= π


Extract the symbolic transform from CoordinateTransformData to apply it to singular points:

In[3]:= transform =
CoordinateTransformData["Polar" -> "Cartesian", "Mapping"]; transform[{1, 3 Pi}]

Out[4]= {-1, 0}


So FromPolarCoordinates exists expressly to check its arguments for "normal restrictions of polar coordinates" -- if you want the generalized form you are supposed to use something else.