Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: ParametricLinePlot3D
Replies: 2   Last Post: Nov 11, 2013 12:01 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Bob Hanlon

Posts: 890
Registered: 10/29/11
Re: ParametricLinePlot3D
Posted: Nov 7, 2013 12:21 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


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@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
>
>





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.