The documentation for RevolutionPlot3D
shows that you can specify a parametric curve like this:
RevolutionPlot3D[{u, u}, {u, 0, 1}]
I'd like to do this with a Piecewise
function for {fx,fz}
:
RevolutionPlot3D[Piecewise[{{{u, u}, u < 0.5}, {{u, 0.5}, u >= 0.5}}], {u, 0,
1}]
but I get messages and a blank plot:
Dot::rect: Nonrectangular tensor encountered.
whereas a Piecewise
function for {fx,fz}
works in ParametricPlot
, for example:
ParametricPlot[Piecewise[{{{u, u}, u < 0.5}, {{u, 0.5}, u >= 0.5}}], {u, 0, 1}]
By writing Piecewise
expressions for fx
and fz
separately, it works:
RevolutionPlot3D[{Piecewise[{{u, u < 0.5}, {u, u >= 0.5}}],
Piecewise[{{u, u < 0.5}, {0.5, u >= 0.5}}]}, {u, 0, 1}]
How is it possible to piece together a function for {fx,fz}
in RevolutionPlot3D
?
RevolutionPlot3D[Function[t, {t, t}][u], {u, 0, 1}]
doesn't work either. $\endgroup$RevolutionPlot3D[Evaluate[cone[u]], {u, 0, 1}]
. $\endgroup$Piecewise
function. I'm going to update the question. $\endgroup$RevolutionPlot3D[Evaluate[Boole[u < 0.5] {u, u} + Boole[u >= 0.5] {u, 0.5}], {u, 0, 1}]
works well (using Heike's suggestion); if you remove theEvaluate[]
, it fails. Very peculiar... $\endgroup$