Re: Colorfunction based upon flux direction

• To: mathgroup at smc.vnet.net
• Subject: [mg86944] Re: Colorfunction based upon flux direction
• From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
• Date: Thu, 27 Mar 2008 08:15:47 -0500 (EST)
• References: <fsd6ps\$9hd\$1@smc.vnet.net>

```Hi,

what direction ? in 2d there is only one angle
and you can use the cyclic Hue[] color to draw
the scalar angle as direction but in 3d ??

Needs["VectorFieldPlots`"]
plt = ListVectorFieldPlot3D[
Flatten[Table[{{i, j, k}, {i, 2 j, -k}}, {i, 0, 1, 0.1}, {j, 0, 1,
0.1}, {k, 0, 1, 0.1}], 2], ScaleFactor -> 0.2]

and

Off[ArcTan::indet]
(plt /. Line[{p1_, p2_}] :> {Hue[ArcTan @@ Take[p2 - p1, 2]/(2 Pi)],
Line[{p1, p2}]}) /. Hue[_Interval] :> Sequence[]

may give you an idea.

Regards
Jens

ptk4m at virginia.edu wrote:
> Hello,
>
> I'm quite new at using Mathematica and I am attempting to assign
> colors to vector field data (3d magnetic flux) using the
> ListVectorFieldPlot3D function.  I would like to assign colors to the
> vectors based upon the direction in which they point.  Hue gives me a
> color based upon vector magnitude - is there a simple way to color
> vectors based upon direction?
>
> Thank you very much for your help.
>
> Patrick Keith-Hynes
> University of Virginia Physics
>
>

```

• Prev by Date: Re: Problems with differentiating Piecewise functions
• Next by Date: Re: Problems with differentiating Piecewise functions
• Previous by thread: Colorfunction based upon flux direction
• Next by thread: Series and Sqrt problem (a bug?)