MathGroup Archive 2006

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

Search the Archive

Re: Re: ListSphericalDensityPlot[] ??

  • To: mathgroup at smc.vnet.net
  • Subject: [mg64587] Re: [mg64546] Re: ListSphericalDensityPlot[] ??
  • From: Pratik Desai <pdesai1 at umbc.edu>
  • Date: Thu, 23 Feb 2006 00:34:38 -0500 (EST)
  • References: <dte2gk$rjm$1@smc.vnet.net> <200602221058.FAA23427@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Jens-Peer Kuska wrote:

>Hi,
>
>make a Graphics[] object out of your density plot 
>and
>than transform the polygons, i.e,
>gr = DensityPlot[
>       Re[SphericalHarmonicY[4, 2, th, phi]], {th, 
>0, Pi}, {phi, 0, 2Pi},
>       PlotPoints -> {64, 128}] // Graphics;
>
>gg = gr /. Raster[bm_, {{x1_, y1_}, {x2_, y2_}}, 
>{z1_, z2_}, ___] :>
>             Block[{n, m, dx, dy, poly},
>               {n, m} = Dimensions[bm];
>               dx = (x2 - x1)/m; dy = (y2 - y1)/n;
>               poly[{j_, i_}] := Block[{p}, p = 
>{x1, y1} + {dx, dy}*{i - 1, j - 1};
>               Polygon[{p, p + {dx, 0}, p + {dx, 
>dy}, p + {0, dy}}]];
>               MapIndexed[{GrayLevel[(#1 - 
>z1)/(z2 - z1)], poly[#2]} &, bm, {2}]
>             ];
>
>Show[Graphics3D[{EdgeForm[],
>  gg[[1]]} /. {(h : (Polygon | Line))[pnts_] :>
>  Polygon[{Cos[#[[2]]]*Sin[#[[1]]], 
>Sin[#[[2]]]*Sin[#[[1]]],
>    Cos[#[[1]]]} & /@ pnts],
>    GrayLevel[g_] :> SurfaceColor[Hue[g]]}
>  ]
>];
>
>  
>
This is awesome!!

Thanks
Jens


>Regards
>
>  Jens
>
>
>"Bob Buchanan" <Bob.Buchanan at millersville.edu> 
>schrieb im Newsbeitrag 
>news:dte2gk$rjm$1 at smc.vnet.net...
>| Hello,
>|
>| I have numerically approximated the omega-limit 
>set of a model of a spherical, magnetic pendulum. 
>For a grid of theta and phi coordinates on the 
>unit sphere I have numerically solved the 
>Hamiltonian system of ODEs governing the pendulum 
>until it comes to rest (or pretty close to rest). 
>The data is in the form of a rectangular array 
>which I can easily display as a rectangular list 
>density plot.
>|
>| Is there a way to wrap this density plot back 
>around the surface of the unit sphere ---  
>something like a ListSphericalDensityPlot[] 
>function?
>|
>| I don't think there is an already defined 
>function to perform this type of operation. Is 
>there an easy way to do it myself?
>|
>| Thanks for any suggestions.
>|
>| Bob Buchanan
>| Bob.Buchanan at millersville.edu
>| 
>
>
>  
>


  • Prev by Date: Re: Code to translate to negative base...
  • Next by Date: Re: General--Making the DisplayFormula style in ArticleModern look like Traditional
  • Previous by thread: Re: ListSphericalDensityPlot[] ??
  • Next by thread: How if I want to assume that -------