Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: SurfaceOfRevolution

  • To: mathgroup at smc.vnet.net
  • Subject: [mg33877] RE: [mg33833] SurfaceOfRevolution
  • From: "David Park" <djmp at earthlink.net>
  • Date: Sun, 21 Apr 2002 06:12:25 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Wes,

You can rotate a SurfaceOfRevolution plot about a point not the origin by
simply shifting the origin. Here is an example:

Needs["Graphics`SurfaceOfRevolution`"]
Needs["Graphics`Colors`"]
Needs["Graphics`Animation`"]

First, we plot a surface and extract the primitive graphics by taking the
First part.

surface = First[SurfaceOfRevolution[Sin[x], {x, 0, 2*Pi},
     DisplayFunction -> Identity]];

Then we shift all the plot points so the origin is at {2Pi,0,0}.

surface = surface /. {x_?NumberQ, y_?NumberQ, z_?NumberQ} -> {x + 2 Pi, y,
z};

Now, we plot the shifted surface and a vertical line at the origin.

plot1 =
    Show[
      Graphics3D[
        {surface,
          AbsoluteThickness[2], Red,
          Line[{{0, 0, -2}, {0, 0, 2}}]}],
      PlotRange -> {{-4Pi, 4Pi}, {-4Pi, 4Pi}, {-2, 2}},
      Boxed -> False,
      ImageSize -> 400];

This rotates the resulting image.

SpinShow[plot1]
SelectionMove[EvaluationNotebook[], All, GeneratedCell]
FrontEndTokenExecute["OpenCloseGroup"]
FrontEndTokenExecute["SelectionAnimate"]

There are other variations depending upon your exact need. The whole process
is slightly easier using my DrawGraphics package, at my web site, because
the primitive graphics are immediately available for manipulation, there is
a DrawingTransform command for mapping plot points, and there is a
CustomTicks command for transforming and relabeling ticks.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/


> From: Wes [mailto:Negoham at insightBB.com]
To: mathgroup at smc.vnet.net
>
>
> Might anyone out there know of a method by which I could use the
> SurfaceOfRevolution command to rotate a graph about a line that does NOT
> pass through the origin? Can such a thing be done?
>
>



  • Prev by Date: Question about Removed[]
  • Next by Date: Re: Bug in Sum causes index variable to remain set?
  • Previous by thread: SurfaceOfRevolution
  • Next by thread: Re: computation of d-integral on unbounded interval