Is it possible to revolve a function around a line instead of an axis?
For instance I would like to revolve the quadratic function:
f[x_]:=-0.45(x-1.5)^2
Around the x=3, z=0
line.
General approach is covered by this answer form the Q&A which link is provided by Öskå.
As I've said in comments, you may translate your function so the x = 3, z = 0
line will be an y-axis.
f[x_] := (-0.45 (x - 1.5)^2)
Plot[{f[x], f[x + 3]}, {x, -5, 5},
Epilog -> {Thick, Blue, Line[{{3, -25}, {3, 5}}], Red, Line[{{0, -25}, {0, 5}}]},
AxesLabel -> {"x", "y"}, AxesStyle -> [email protected]]
Then revolve it around y-axis:
plot = RevolutionPlot3D[{x, f[x + 3], 0}, {x, -5, 5},
RevolutionAxis -> {0, 1, 0}, AxesOrigin -> {0, 0, 0},
ImageSize -> 500, PlotRange -> 15, BaseStyle -> Orange,
AxesStyle -> {Red, Green, Blue}
]
and translate it back:
Translate[#, {3, 0, 0}] & @@ plot //Graphics3D[#, Axes -> True, PlotRange -> 15,
AxesOrigin -> {0, 0, 0}, ImageSize -> 500,
AxesStyle -> {Red, Green, Blue}] &
MeshShading
and you got a Smurf house
$\endgroup$
{-3, 0, 0}
and then useRevolutionAxis->
$\endgroup$