Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9406 > unrolled thread
| Started by | Mike Zentner <zentner.mike@gmail.com> |
|---|---|
| First post | 2012-04-04 08:28 +0000 |
| Last post | 2012-04-09 09:36 +0000 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
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
| From | Mike Zentner <zentner.mike@gmail.com> |
|---|---|
| Date | 2012-04-04 08:28 +0000 |
| Subject | 3D Rotations |
| Message-ID | <jlh0o5$t75$1@smc.vnet.net> |
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.
[toc] | [next] | [standalone]
| From | Helen Read <readhpr@gmail.com> |
|---|---|
| Date | 2012-04-05 10:00 +0000 |
| Message-ID | <jljqgc$d3t$1@smc.vnet.net> |
| In reply to | #9406 |
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
[toc] | [prev] | [next] | [standalone]
| From | "Alexander Elkins" <alexander_elkins@hotmail.com> |
|---|---|
| Date | 2012-04-09 09:36 +0000 |
| Message-ID | <jluajl$rs0$1@smc.vnet.net> |
| In reply to | #9406 |
Currently you have this cross-sectional view:
Show[Plot[x^3, {x, 0, 2}],
Graphics[{Arrowheads[{-.05, .05}], Arrow[{{0, 0}, {0, 8}}]}]]
My guess is that you want a cross-sectional view like this:
Show[Plot[(x - 1)^3, {x, 0, 2}],
Graphics[{Arrowheads[{-.05, .05}], Arrow[{{0, -1}, {0, 1}}]}]]
Just enter the following to see this as a surface of revolution:
RevolutionPlot3D[(x - 1)^3, {x, 0, 2},
AxesLabel -> (Style[#, 16, Italic] & /@ {x, z, y})]
To place several of these, use [[1]] to pick out the graphics like so:
Graphics3D[{GeometricTransformation[
RevolutionPlot3D[(x - 1)^3, {x, 0, 2}][[1]], {
{RotationMatrix[0 Degree, {0, 1, 0}], {0, 0, 2}},
{RotationMatrix[90 Degree, {0, 1, 0}], {2, 0, 0}},
{RotationMatrix[180 Degree, {0, 1, 0}], {0, 0, -2}},
{RotationMatrix[-90 Degree, {0, 1, 0}], {-2, 0, 0}}}], Thick,
Magenta, Line[{{{0, 0, -2}, {0, 0, 2}}, {{-2, 0, 0}, {2, 0, 0}}}]}]
Hope this helps...
"Mike Zentner" <zentner.mike@gmail.com> wrote in message
news:jlh0o5$t75$1@smc.vnet.net...
> 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.
>
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web