# ParametricPlot3D of filled out 3D shape?

I am trying to parameterize 2D and 3D Euclidean space by the variables:

$\qquad -\infty < x < +\infty,\, 0 < \phi < \pi$ and $0 < \theta < \pi$

To check that my parametrization is correct, I am plotting some ranges in these variables to explicitly see how it fills out the space. For instance, in 2D:

ParametricPlot[{Re[x Exp[I ϕ]], Im[x Exp[I ϕ]]}, {x, -10, 5}, {ϕ, 0, π}]


we can see how for values x<0 the lower half plane gets filled out, while for x>0 that happens for the upper half plane, such that for -Infinity < x < +Infinity the whole space is traversed once.

Now, if I try to do the same check in the 3D case, I get an error message:

ParametricPlot3D[
{Re[x Exp[I ϕ] Sin[θ]], Im[x Exp[I ϕ] Sin[θ]], x Cos[θ]},
{x, -10, 5}, {ϕ, 0, π/3}, {θ, 0, π/4}]


ParametricPlot3D::nonopt

It seems that ParametricPlot3D, even though it is a 3D function, cannot deal with 3 variables. How should I be plotting the filled out 3D region instead?

• In general, you should have at most one less parameter than the space you are filling. So in 2D space, you have a curve parameterized by a single parameter. In 3D space, you can have a curve parameterized by a single parameter, or have a surface parameterized by two parameters. – MikeY May 10 '17 at 14:14
• @MikeY Right, so what if I want to have a hypersurface in 3D parametrized by 3 parameters? Clearly, the 2D case did allow me to use two parameters to parametrize a surface, so why should that not work in 3D with three parameters? – Kagaratsch May 10 '17 at 14:15
• Take a look at RegionPlot3D[ ]. You are going from spherical to cartesian in your conversion, if you rewrite the equations from cartesian to spherical, so for example $r2=x^2+y^2+z^2$ then you can specify the region to plot in terms of your bounds on r, phi, and theta, so fill region where $x^2+y^2+z^2 < r_max && phibound && thetabound$. PS: I have no idea how I made a box around that equation! – MikeY May 10 '17 at 14:41

You could always treat it as a Region.

pr = ParametricRegion[
ComplexExpand[{Re[x Exp[I ϕ] Sin[θ]], Im[x Exp[I ϕ] Sin[θ]], x Cos[θ]}],
{{x, -10, 5}, {ϕ, 0, π/3}, {θ, 0, π/4}}
];

Region[pr]


Or dress it up a bit:

Region[pr, BoxRatios -> {1, 1, 1}, Boxed -> True,
Axes -> True, AxesLabel -> {x, ϕ, θ}]


Alternatively BoundaryDiscretizeRegion produces a similar looking output.

I ended up doing the following workaround, discretizing the ϕ variable, e.g.:

Show[Table[
ParametricPlot3D[
{Re[x Exp[I ϕ] Sin[θ]], Im[x Exp[I ϕ] Sin[θ]], x Cos[θ]},
{x, -10, 5}, {θ, 0, π/2}]
, {ϕ, 0, π/2, π/200}], PlotRange -> All]


The graphics is a bit heavy to rotate, since so many surfaces are overlapped. But it is good enough for a visualization in my opinion.

The quick and dirty approach is just to throw down points on your domain. If you want to be fancy you can connect them with lines or surfaces. You can even color code them or add mouseovers. Here is just the barebones version though:

Show[Graphics3D[
Table[
Point[{Re[x Exp[I \[Phi]] Sin[\[Theta]]],
Im[x Exp[I \[Phi]] Sin[\[Theta]]], x Cos[\[Theta]]}],
{x, -10, 5,0.2},
{\[Phi], 0, \[Pi]/3, Pi/24},
{\[Theta], 0, \[Pi]/4, Pi/24}]]]