MathGroup Archive 2013

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

Search the Archive

Re: ParametricLinePlot3D


Your example works for an initial evaluation since v is undefined when
Ringsweep1 is defined. However, for subsequent evaluations the last value
of v carries over and Ringsweep1 is defined with that value of v. Hence
subsequent changes in v are not reflected in Ringsweep1. Just clear v prior
to defining Ringsweep1.


Clear[v];


R = 2.; a = 1.;


Ringsweep1[u_] = {
   a Cos[R Sin[u]/a] Cos[v] - Sin[v]*a Sin[R Sin[u]/a],
   a Cos[R Sin[u]/a] Sin[v] + Cos[v]*a Sin[R Sin[u]/a],
   R Cos[u]};


v = Pi/3;


g1 = ParametricPlot3D[
   Tooltip[Ringsweep1[u], StringForm["v = ``", v]],
   {u, 0, 2 Pi},
   PlotStyle -> {Red, Thick}];


v = 2 Pi/3;


g2 = ParametricPlot3D[
   Tooltip[Ringsweep1[u], StringForm["v = ``", v]],
   {u, 0, 2 Pi},
   PlotStyle -> {Blue, Thick}];


v = 4 Pi/3;


g3 = ParametricPlot3D[
   Tooltip[Ringsweep1[u], StringForm["v = ``", v]],
   {u, 0, 2 Pi},
   PlotStyle -> {Green, Thick}];


Show[{g1, g2, g3}, PlotRange -> All]


This can be shortened to


ParametricPlot3D[
 Evaluate[Table[
   Tooltip[Ringsweep1[u], StringForm["v = ``", v]],
   {v, {Pi/3, 2 Pi/3, 4 Pi/3}}]],
 {u, 0, 2 Pi},
 PlotStyle -> ({Thick, #} & /@ {Red, Blue, Green})]



Bob Hanlon




On Wed, Nov 6, 2013 at 12:35 AM, Narasimham <mathma18 at gmail.com> wrote:

> Or least, why should the v new parameter values be ignored in subsequent
> settings when the function is solely dependent on u only?
>
> R = 2.; a = 1.;
> Ringsweep1[u_] = {a Cos[R Sin[u]/a] Cos[v] - Sin[v]*a Sin[R Sin[u]/a],
>     a Cos[R Sin[u]/a] Sin[v] + Cos[v]*a Sin[R Sin[u]/a], R Cos[u]};
> v = Pi/3;
> g1 = ParametricPlot3D[Ringsweep1[u], {u, 0, 2 Pi},
>   PlotStyle -> {Red, Thick}]
> v = 2 Pi/3;
> g2 = ParametricPlot3D[Ringsweep1[u], {u, 0, 2 Pi},
>   PlotStyle -> {Red, Thick}]
> v = 4 Pi/3;
> g3 = ParametricPlot3D[Ringsweep1[u], {u, 0, 2 Pi},
>   PlotStyle -> {Red, Thick}]
> Show[{g1, g2, g3}, PlotRange -> All]
>
> Under such circumstances, why Manipulating by varying v is not possible
> inside its Box?
>
> Regards
> Narasimham
>
>



  • Prev by Date: Re: Data format AFTER import into Mathematica from Excel.xls worksheet
  • Next by Date: Unit conversion of a list of quantities
  • Previous by thread: Re: ParametricLinePlot3D
  • Next by thread: Re: ParametricLinePlot3D