Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9447

Re: 3D Rotations

From Helen Read <readhpr@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: 3D Rotations
Date 2012-04-05 10:00 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jljqgc$d3t$1@smc.vnet.net> (permalink)
References <jlh0o5$t75$1@smc.vnet.net>

Show all headers | View raw


On 4/4/2012 4:28 AM, Mike Zentner wrote:
> I am trying to rotate a function around a variable axis to show my
> students how the solid looks and am having problems with the axis of
> rotation.
>
> Basic example:
>
> RevolutionPlot3D[x^3, {x, 0, 2}, AxesLabel ->  {x, z, y}]
>
> However I want the function to rotate around an axis other than x ==
> 0, say, x == -1.  I have tried the RevolutionAxis command but it isn't
> working.  Any help would be appreciated.
>

Unfortunately RevolutionPlot3D will only revolve about an axis that runs 
through the origin. But your can roll your own. For example, here is 
sin(x) revolved around x=-2, for x from 0 to Pi.

f[x_] := Sin[x]

ParametricPlot3D[{(x + 2) Cos[t] - 2, (x + 2) Sin[t], f[x]}, {x,
   0, \[Pi]}, {t, 0, 2 \[Pi]}]

You can put a bottom on it to make it look nicer when you drag and 
rotate it, like this.

ParametricPlot3D[{{(x + 2) Cos[t] - 2, (x + 2) Sin[t],
    f[x]}, {(x + 2) Cos[t] - 2, (x + 2) Sin[t], 0}}, {x, 0, \[Pi]}, {t,
    0, 2 \[Pi]}]


Here it is revolved around y=3.

ParametricPlot3D[{x, (3 - f[x]) Cos[t], (3 - f[x]) Sin[t] + 3}, {x,
   0, \[Pi]}, {t, 0, 2 \[Pi]}]


You might like to put sides on it.

plot1 = ParametricPlot3D[{x, (3 - f[x]) Cos[t], (3 - f[x]) Sin[t] +
      3}, {x, 0, \[Pi]}, {t, 0, 2 \[Pi]}];
plot2 = ParametricPlot3D[{{0, 3 r Cos[t], 3 r Sin[t] + 3}, {\[Pi],
      3 r Cos[t], 3 r Sin[t] + 3}}, {r, 0, 1}, {t, 0, 2 \[Pi]}];
Show[{plot1, plot2}]

I do wish that RevolutionPlot3D would take things like x==-2 or y==3 for 
the RevolutionAxis. My Calculus 2 students often ask how to revolve 
around something other than the x- or y-axis when we are doing volume or 
surface area. I post examples online for them to see, but there really 
isn't any way they are going to be able plot things like that on their 
own, given that they have not yet had multi-variable calculus.

-- 
Helen Read
University of Vermont

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

3D Rotations Mike Zentner <zentner.mike@gmail.com> - 2012-04-04 08:28 +0000
  Re: 3D Rotations Helen Read <readhpr@gmail.com> - 2012-04-05 10:00 +0000
  Re: 3D Rotations "Alexander Elkins" <alexander_elkins@hotmail.com> - 2012-04-09 09:36 +0000

csiph-web