MathGroup Archive 2011

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

Search the Archive

Re: ViewPoint selector (Stan Wagon's)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119290] Re: ViewPoint selector (Stan Wagon's)
  • From: "Nasser M. Abbasi" <nma at 12000.org>
  • Date: Sun, 29 May 2011 07:36:49 -0400 (EDT)
  • References: <irntfc$sni$1@smc.vnet.net> <irqlp5$e90$1@smc.vnet.net>
  • Reply-to: nma at 12000.org

On 5/28/2011 4:20 AM, Nasser M. Abbasi wrote:

Just added a tiny improvement to the above (added labels to
the slides).

-------------------------------
Manipulate[
    (
     title=Style[Grid[{
        {"ViewPoint = ",s[r Cos[\[Theta] Degree]],s[r Sin[\[Theta] Degree]],s[z]}},
         Frame->All,
         Spacings->{1,1}],14
     ];

     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] Degree],r Sin[\[Theta] Degree],z}],
            PlotLabel->title,
            ImageSize->300,
            ImagePadding->{{10,10},{10,35}}]
     ),

     {{\[Theta],0,"\[Theta]"},0,360,Appearance->"Labeled"},
     {{r,1},0,100,Appearance->"Labeled"},
     {{z,1},-100,100,Appearance->"Labeled"},

     Initialization:>
     (
      f[x_,y_]:=(x^2+3 y^2) E^(1-x^2-y^2);
      s[n_] := NumberForm[Chop[n],
                          {6,3},
                          NumberSigns->{"-","+"},
                          NumberPadding->{"0","0"},
                          SignPadding->True];
      )
]
-----------------------------------------


-Nasser


  • Prev by Date: Re: CreateCellID
  • Next by Date: Re: how to calculate an index and vice versa [ADDENDUM]
  • Previous by thread: Re: ViewPoint selector (Stan Wagon's)
  • Next by thread: Rounding to a certain number of decimal places