# How to graph a 3D function of two variables? [closed]

How to graph this:

\begin{alignat*}{3} x(s, t) &= a\cos(mt) \cos^{k}(ns) &&\cos(t) &&\cos(s), \\ y(s, t) &= a\cos(mt) \cos^{k}(ns) &&\sin(t) &&\cos(s), \\ z(s, t) &= a\cos(mt) \cos^{k}(ns) &&\sin(s) && \end{alignat*}

The following is: $m = 4$, $n = 1$, and $k = 8$:

The underlying idea is to take $\rho = \cos(m\theta)\cos^{k}(n\phi)$ in spherical coordinates $$(x, y, z) = (\rho\cos\theta \cos\phi, \rho\sin\theta \cos\phi, \rho\sin\phi).$$

Source

• I'm voting to close this question as off-topic because questions about how to use Wolfram|Alpha are explicitly off topic – Michael E2 Jun 13 '16 at 1:13
• Stink, I will just remove the WOlfram Alpha part. – Dale Jun 13 '16 at 1:16
• Possible duplicate of problem with coloring spherical harmonics – Jens Jun 13 '16 at 4:04
• vote to re-open? – Dale Jun 14 '16 at 19:56
• But have you looked up SphericalPlot3D[] in the docs? – J. M. is in limbo Jun 14 '16 at 23:43

{a, m, n, k} = {1, 4, 1, 8};

ParametricPlot3D[a Cos[m t] Cos[n s]^k Cos[s] { Cos[t], Sin[t], Sin[s]/Cos[s]},
{s, -Pi, Pi}, {t, -Pi, Pi}, PlotRange -> All, Mesh -> 40]


Alternatively,

x[s_, t_] := a Cos[m t] Cos[n s]^k Cos[t] Cos[s];
y[s_, t_] := a Cos[m t] Cos[n s]^k Sin[t] Cos[s];
z[s_, t_] := a Cos[m t] Cos[n s]^k Sin[s];
ParametricPlot3D[{x[s, t], y[s, t], z[s, t]}, {s, -Pi, Pi}, {t, -Pi,
Pi}, PlotRange -> All, Mesh -> 40]
(* ==> same picture *)