2
$\begingroup$

What a mistake I make that the animation does not work:

(* Surface *)
r[u_, v_] := { u, u Cos[v], u Sin[v]};

(* u - curve on surface *)
v0[a_] := a;
uconr := r[u, v0[a]];

(* v - curve on surface *)
u0[b_] := b;
vconr := r[u0[b], v];

(* ANIMATION *)

(* Surface *)
rV = ParametricPlot3D[r[u, v], {u, -2 Pi, 2 Pi}, {v, 0, 2 Pi}];

(* u - curve on surface *)
uconrA := 
  ParametricPlot3D[uconr, {u, -2 Pi, 2 Pi}, PlotStyle -> Magenta];

(* v - curve on surface *)
vconrA := ParametricPlot3D[vconr, {v, 0, 2 Pi}, PlotStyle -> Cyan];

Animate[Show[{rV, uconrA, vconrA}, 
  PlotRange -> {{-5, 5}, {-5, 5}, {-5, 5}}, 
  BaseStyle -> {FontSize -> 12, FontFamily -> "Verdena"}, 
  Axes -> True, AxesLabel -> {x, y, z}, Ticks -> Automatic, 
  AxesStyle -> {Red, Green, Blue}, 
  PlotLabel -> 
   Style[Framed["u - curve and v - curve on the cone surface", 
     FrameStyle -> Red], Bold, 14, Darker[Blue, .6], 
    Background -> Lighter[LightYellow]], 
  BaseStyle -> {FontSize -> 12, FontFamily -> "Verdena"}], {a, 0, 
  2 Pi}, {b, -2 Pi, 2 Pi}, AnimationRunning -> False]

Animation works if the code looks like this:

(* Surface *)
r[u_, v_] := { u, u Cos[v], u Sin[v]};

(* u - curve on surface *)
v0[a_] := a;
uconr := r[u, v0[a]];

(* v - curve on surface *)
u0[b_] := b;
vconr := r[u0[b], v];

(* ANIMATION *)

(* Surface *)
rV = ParametricPlot3D[r[u, v], {u, -2 Pi, 2 Pi}, {v, 0, 2 Pi}];

Animate[Show[{rV, 
   ParametricPlot3D[r[u, v0[a]], {u, -2 Pi, 2 Pi}, 
    PlotStyle -> Magenta], 
   ParametricPlot3D[r[u0[b], v], {v, 0, 2 Pi}, PlotStyle -> Cyan]}, 
  PlotRange -> {{-5, 5}, {-5, 5}, {-5, 5}}, 
  BaseStyle -> {FontSize -> 12, FontFamily -> "Verdena"}, 
  Axes -> True, AxesLabel -> {x, y, z}, Ticks -> Automatic, 
  AxesStyle -> {Red, Green, Blue}, 
  PlotLabel -> 
   Style[Framed["u - curve and v - curve on the cone surface", 
     FrameStyle -> Red], Bold, 14, Darker[Blue, .6], 
    Background -> Lighter[LightYellow]], 
  BaseStyle -> {FontSize -> 12, FontFamily -> "Verdena"}], {a, 0, 
  2 Pi}, {b, -2 Pi, 2 Pi}, AnimationRunning -> False]

However, I would like to understand why the first code does not work. Understanding this fact is very important to me because I think it has to do with defining uconr, vconr and uconrA, vconrA. And this is the point of the matter for me.

$\endgroup$
  • $\begingroup$ You could probably simplify your question to a minimal example, to make it easier to help. $\endgroup$ – anderstood Dec 24 '17 at 0:35
  • $\begingroup$ a minimal version of the issue: Animate[Show[vconrA, PlotRange -> {{-5, 5}, {-5, 5}, {-5, 5}}], {b, -2 Pi, 2 Pi}, AnimationRunning -> False] does not work, but Animate[Show[{ParametricPlot3D[r[u0[b], v], {v, 0, 2 Pi}, PlotStyle -> Cyan]}, PlotRange -> {{-5, 5}, {-5, 5}, {-5, 5}}], {b, -2 Pi, 2 Pi}, AnimationRunning -> False] does. $\endgroup$ – kglr Dec 24 '17 at 2:49
  • $\begingroup$ If you rewrite uconrA and vconrA as functions of a and b (i.e.: uconrA[a_] := same definition and vconrA[b_] := same definition) then it works. Something to do with injecting the values of a and b into the plots. $\endgroup$ – aardvark2012 Dec 24 '17 at 5:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.