# Transform polar coordinates to rectangular

I am not satisfied, I'll be wrong? I used this

Simplify[r*Cos[θ]^2 ==
Sqrt[2]*Sin[θ + π/4] /. {r -> Sqrt[x^2 + y^2],
z -> ArcTan[y/x]}]


• why would you expect the z-> rule to do anything when there is no z in your expression? Commented Nov 1, 2016 at 23:54

Perhaps this?

Simplify@TransformedField["Polar" -> "Cartesian",
r*Cos[θ]^2 == Sqrt[2]*Sin[θ + Pi/4], {r, θ} -> {x, y}]


(Note Pi is spelled, like all Mathematica keywords, with an initial capital.)

• **(Note Pi is spelled, like all Mathematica keywords, with an initial capital.)**The latter do not understand, ah one more thing, what would be the reverse order of Cartesian to polar thank you very much for your attention Commented Nov 1, 2016 at 23:29
• @juanmuñoz The reverse would be TransformedField["Cartesian" -> "Polar",...]. You can find other transformations in the documentation for TransformedField, which explains how the function works. Commented Nov 1, 2016 at 23:32
• @juanmuñoz You wrote pi in your question. It should be Pi, with an initial capital P. Feyre has changed it to π for some unknown reason. (I would have thought it bad form to introduce fixes in someone else's question.) -- All Mathematica function names and other keywords use capital letters (Sin[], Cos[], E, etc.). Commented Nov 2, 2016 at 2:13

Just a rule based way (I have voted for MichaelE2's answer which uses a built-in function):

eq = r Cos[t]^2 == Sqrt[2] Sin[t + Pi/4];
den = Sqrt[x^2 + y^2];
re = Simplify[
TrigExpand[eq] /. {r -> den, Cos[t] -> x/den, Sin[t] -> y/den}];
Legended[Show[Plot[y /. Solve[re, y][[1]], {x, -3, 3}],
PolarPlot[Sqrt[2] Sin[t + Pi/4]/Cos[t]^2, {t, -Pi/3, Pi/4},
PlotStyle -> Red], Frame -> True],
LineLegend[{Blue, Red}, {"\!$$\*SuperscriptBox[\(x$$, $$2$$]\)-x",
"r= \!$$\*SqrtBox[\(2$$]\)\!$$\*FractionBox[\(\(\\\$$$$Sin[t + \ π/4]$$\), SuperscriptBox[$$Cos[t]$$, $$2$$]]\)"}]]


Note: y /. Solve[re, y][[1]] yields :-x+x^2