MathGroup Archive 1999

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

Search the Archive

Re: Vector Field

  • To: mathgroup at smc.vnet.net
  • Subject: [mg16306] Re: Vector Field
  • From: adam.smith at hillsdale.edu
  • Date: Sun, 7 Mar 1999 01:05:37 -0500
  • Organization: Deja News - The Leader in Internet Discussion
  • References: <7bg1g5$5l8@smc.vnet.net> <7bntqq$diq@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Although Jens method works, I prefer the method listed below.  If I understand
you, you want the arrows to "sit" on the surface of the sphere.  Jens method
produces a representation of the vector field everywhere withing the "box".
The steps listed below are more involved but result in only the vectors "on"
the sphere being shown.  Jens is more correct in that the vector field exists
everywhere in space, while my constrains it to only one chosen radius.

Anyway that is my two cents worth.

Adam

Note:  this is my third attempt at this.  My first post with the error somehow
disappeared and my correction to it appeared (meaning that it made on sense).

In[1]:=
<<Graphics`PlotField3D`
In[2]:=
field = PlotGradientField3D[
    1/(1 + x^2 + y^2 + z^2), {x, -1.2, 1.2}, {y, 0, 1.2}, {z, -1.2, 1.2},
    VectorHeads ->True,DisplayFunction->Identity]

In[3]:=
sph = ParametricPlot3D[{Cos[phi]*Sin[th], Sin[phi]*Sin[th], Cos[th]}, {phi,
      0, Pi}, {th, 0, Pi},DisplayFunction->Identity]
In[4]:=
Show[{sph, field},DisplayFunction->$DisplayFunction]

In article <7bntqq$diq at smc.vnet.net>,
  Jens-Peer Kuska <kuska at informatik.uni-leipzig.de> wrote:
> Hi Luke,
>
> why to use Photoshop to overlay the images ? The combination is easy:
>
> field = PlotGradientField3D[1/(1 + x^2 + y^2 + z^2), {x, -1.2, 1.2},
>     {y, 0, 1.2}, {z, -1.2, 1.2}, VectorHeads ->
> True,DisplayFunction->Identity]
>
> sph = ParametricPlot3D[{Cos[phi]*Sin[th], Sin[phi]*Sin[th], Cos[th]},
>     {phi, 0, Pi}, {th, 0, Pi},DisplayFunction->Identity]
>
> Show[{sph, field},DisplayFunction->$DisplayFunction]
>
> Hope that helps
>   Jens
>
> Luke wrote:
> >
> > I am trying to create a picture of a sphere with Normal vectors on the
> > surface to demonstrate the Divergence Theorum. I am quite new to Mathematica
> > and I was wondering if it could be done.
> >
> > I have created the sphere using:
> >
> > ParametricPlot3D[{Sin[x]*Cos[y],Sin[x]*Sin[y],Cos[x]},{x,0,Pi},{y,0,2*Pi}]
> >
> > I am hoping to be able to use PlotVectorField3D to create a vector field and
> > overlay in on the image using Photoshop where I could remove the vector
> > which should not be in view. I'm not sure how to plot the field desired.
> >
> > Anyone have any suggestions?
> >
> > Luke
>
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


  • Prev by Date: Re: Vector Field
  • Next by Date: Re: Vector Field
  • Previous by thread: Re: Vector Field
  • Next by thread: Re: Vector Field