MathGroup Archive 2011

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

Search the Archive

ViewPoint selector (Stan Wagon's)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119258] ViewPoint selector (Stan Wagon's)
  • From: "Christopher O. Young" <cy56 at comcast.net>
  • Date: Fri, 27 May 2011 06:13:05 -0400 (EDT)

Here's a handy tool for adjusting the viewpoint from the latest edition of
Stan Wagon's "Mathematica in Action".

It's at Google Books at
http://books.google.com/books?id=EbVrWLNiub4C&pg=PA77&dq=Mathematica+%22Mesh
+option%22&source=gbs_selected_pages&cad=3#v=onepage&q&f=true

I'm not sure how to make a function out of this, which will accept any
function of x and y, or better, any 3D plot.

Also, it would be more helpful if it gave the x, y, and z coordinates that
corresponded to the angle, radius, and z coordinates used here.

f[x_, y_] := (x^2 + 3 y^2) E^(1 - x^2 - y^2)   (* Just an example; any 3D
plot should work *)


Manipulate[
 Plot3D[
  f[x, y],
  {x, -2, 2}, {y, -2.5, 2.5},
  Ticks -> All,
  AxesLabel -> {"x", "y", "z"},
  BoxRatios -> {4, 5, 3},
  Ticks -> {{0, 2}, Range[-2, 2], Range[0, 3]},
  SphericalRegion -> True,
  ViewPoint -> Dynamic[{r Cos[\[Theta]], r Sin[\[Theta]], z}],
  PlotLabel -> 
   Dynamic[StringForm["ViewPoint=``",
     NumberForm[Chop[{r Cos[\[Theta]], r Sin[\[Theta]], z}], 3]]
    ]
  ],
 {\[Theta], 0, 2 \[Pi]}, {{r, 1}, 0, 100}, {{z, 1}, -100, 100}
 ]



  • Prev by Date: Pattern matching help
  • Next by Date: Re: Unicode path names not supported on Windows?
  • Previous by thread: Re: Pattern matching help
  • Next by thread: Re: ViewPoint selector (Stan Wagon's)