Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: VectorPlot on a Circle

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114798] Re: VectorPlot on a Circle
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Fri, 17 Dec 2010 03:30:17 -0500 (EST)
  • Reply-to: hanlonr at cox.net

Look at Boole or RegionFunction

With[{d = .041}, 
 VectorPlot[{y, -x} Boole[1 - d < Sqrt[x^2 + y^2] < 1 + d],
  {x, -1, 1}, {y, -1, 1}]]

With[{d = .041}, VectorPlot[{y, -x},
  {x, -1, 1}, {y, -1, 1},
  RegionFunction -> 
   Function[{x, y}, 1 - d < Sqrt[x^2 + y^2] < 1 + d]]]


Bob Hanlon

---- Dave Snead <dsnead6 at charter.net> wrote: 

=============
Hi,

I'm trying to do a vector plot but confine the vectors to a unit circle.

VectorPlot[
If[Abs[x^2 + y^2 - 1] == 0, {x, y}, {0, 0}], {x, -1, 1}, {y, -1, 1}]
only plots a couple of vectors, not the dense set of vectors that I want.

and 
VectorPlot[
If[Abs[x^2 + y^2 - 1] <.1, {x, y}, {0, 0}], {x, -1, 1}, {y, -1, 1}]
plots lots of vectors but they're on an annulus rather than a circle.

Is there any way to do this?

Or more generally is there any way to confine the vectors to a curve.
Or, kicking the dimension up by 1, can VectorPlot3D confine the vectors
to a surface?

Thanks,
Dave Snead



  • Prev by Date: Re: VectorPlot on a Circle
  • Next by Date: Re: VectorPlot on a Circle
  • Previous by thread: Re: Root search on results of minimization with free
  • Next by thread: Re: Cell["\<\ ... \>", ... ; TextData[...]