enter image description hereI want to plot a field of vectors revolving on the inside of a torus in the positive x-direction. I don't know how to constrain the field on Mathematica. What would be the most efficient way to do this?

ParametricPlot3D[{{Sin[u], Cos[u], u/10}, {Cos[u], Sin[u], u/10}}, {u,
   0, 20}]
  Line[x_] :> Sequence[Arrowheads[Table[.025, {50}]], Arrow@Line[x]]
RevolutionPlot3D[{2 + Cos[t], 2 + Sin[t]}, {t, 0, 2 Pi}]

I want to plot vectors like these inside of my torus.

  • $\begingroup$ Welcome to MSE. Please edit your question and add the code you have tried and the problems you faced. $\endgroup$ Jan 24 at 0:54
  • $\begingroup$ You need to add some picture to describe your demand. $\endgroup$
    – cvgmt
    Jan 24 at 0:58
  • $\begingroup$ What is the function about such field? $\endgroup$
    – cvgmt
    Jan 24 at 1:14

1 Answer 1


I'm not really sure of what vector field is desired. It might be {1, 0, 0}, but I'll use {-z, x, y}:

VectorPlot3D[{-z, x, y},
 {x, -1.4, 1.4}, {y, -1.4, 1.4}, {z, -1.4, 1.4},
 RegionFunction -> 
  Function[{x, y, z}, 
   Evaluate[(Norm[{x, y, z} - Normalize@{x, y, 0}] /. 
        Abs -> Identity // Simplify) < 1/3]], 
 VectorPoints -> Fine]

enter image description here

  • $\begingroup$ Yes! This is what I needed, well not exactly of course but the framework! Thank you so much! $\endgroup$ Jan 24 at 8:12
  • $\begingroup$ SliceVectorPlot3D also can help? $\endgroup$
    – yode
    Jan 24 at 8:51
  • $\begingroup$ @yode I thought about it for showing the v.f. on the surface but only now thought about showing it inside the surface, if that's what you mean. Example: i.stack.imgur.com/TPr9n.png $\endgroup$
    – Michael E2
    Jan 24 at 16:54

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.