# Plot a figure in cartesian XY coordinates in 2D using spherical angles

I have the following equations in $$x$$, $$y$$, $$z$$ coordinates:

$$x = R_0[f(\theta,\phi)\sin(\theta)\cos(\phi) + \partial_{\theta}f(\theta,\phi)\cos(\theta)\cos(\phi) - \partial_{\phi}f(\theta,\phi)\sin(\phi)/\sin(\theta)]$$

$$y = R_0[f(\theta,\phi)\sin(\theta)\sin(\phi) + \partial_{\theta}f(\theta,\phi)\cos(\theta)\sin(\phi) + \partial_{\phi}f(\theta,\phi)\cos(\phi)/\sin(\theta)]$$

$$z = R_0[f(\theta,\phi)\cos(\theta) - \partial_{\theta}f(\theta,\phi)\sin(\theta)]$$

with $$f(\theta,\phi) = 1 + \frac{4\epsilon_e}{1-4\epsilon_e}[\cos^4(\theta) + \sin^4(\theta)(1 -2\sin^2(\phi)\cos^2(\phi))]$$

where $$\epsilon_e = 0.047, R_0 = 15$$. Here, $$\theta,\phi$$ are spherical angles

Now, I would like to plot $$(x,y)$$ for $$\epsilon_e = 0.047$$ and $$0$$

This is what I have tried:

f[\[Theta]_, \[Phi]_] :=
1 + ((4 Subscript[\[Epsilon], e])/(
1 - 3 Subscript[\[Epsilon], e]))[(
Cos^4)[\[Theta]] + (
Sin^4)[\[Theta]] (1 - 2 (Sin^2)[\[Phi]] (Cos^2)[\[Phi]] )]
x = Subscript[R, 0][
f[\[Theta]_, \[Phi]_] Sin[\[Theta]] Cos[\[Phi]]  +
Diff[f[\[Theta]_, \[Phi]_], \[Theta]] Cos[\[Theta]] Cos[\[Phi]] -
Diff[f[\[Theta]_, \[Phi]_], \[Phi]] Sin[\[Phi]]/Sin[\[Theta]]]

y = Subscript[R, 0][
f[\[Theta]_, \[Phi]_] Sin[\[Theta]] Sin[\[Phi]]  +
Diff[f[\[Theta]_, \[Phi]_], \[Theta]] Cos[\[Theta]] Sin[\[Phi]] +
Diff[f[\[Theta]_, \[Phi]_], \[Phi]] Cos[\[Phi]]/Sin[\[Theta]]]

z = Subscript[R, 0][
f[\[Theta]_, \[Phi]_] Cos[\[Theta]] -
Diff[f[\[Theta]_, \[Phi]_], \[Theta]] Sin[\[Theta]]]

Can anyone suggest how to proceed forward to plot in XY-2D plane ? Do I have to use SphericalPlot or ListPlot?

Here we have corrected some error in the code.

Subscript[ϵ, e] = 0.047;
Subscript[R, 0] = 15;
f[θ_, ϕ_] :=
1 + (4 Subscript[ϵ, e])/(1 -
3 Subscript[ϵ, e]) (Cos[θ]^4 +
Sin[θ]^4 (1 - 2 Sin[ϕ]^4 Cos[ϕ]^2));
x = Subscript[R,
0] (f[θ, ϕ] Sin[θ] Cos[ϕ] +
D[f[θ, ϕ], θ] Cos[θ] Cos[ϕ] - (D[
f[θ, ϕ], ϕ] Sin[ϕ])/Sin[θ]);
y = Subscript[R,
0] (f[θ, ϕ] Sin[θ] Sin[ϕ] +
D[f[θ, ϕ], θ] Cos[θ] Sin[ϕ] + (D[
f[θ, ϕ], ϕ] Cos[ϕ])/Sin[θ]);
z = Subscript[R,
0] (f[θ, ϕ] Cos[θ] -
D[f[θ, ϕ], θ] Sin[θ]);
ParametricPlot3D[{x, y, z}, {θ, 0, 2 π}, {ϕ, 0,
2 π}]

• thanks. Could you point out what the error was ? And how to plot the xy plan of this fig. ? Commented Apr 26, 2021 at 10:16
• @newstudent ParametricPlot[{x, y}, {θ, 0, 2 π}, {ϕ, 0, 2 π}] Commented Apr 26, 2021 at 10:35
• ParametricPlot[{x, y}, {θ, 0, π/2}, {ϕ, 0, 2 π}, ColorFunction -> Function[{x, y, θ, ϕ}, Hue[z]], ColorFunctionScaling -> False] Commented Apr 26, 2021 at 10:53