Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Is there SphericalListPlot3D?
Replies: 1   Last Post: Mar 29, 2012 3:57 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Oliver Ruebenkoenig

Posts: 237
Registered: 6/28/08
Re: Is there SphericalListPlot3D?
Posted: Mar 29, 2012 3:57 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply



On Wed, 28 Mar 2012, Ted Sariyski wrote:

> Hi,
> I have two related questions.
>
> 1. I have a discrete set of data, {{n1,rad1},{n2,rad2},...}, where n1,n2
> are unit vectors (directions) and rad1,rad2,... are scalars. How can I
> plot rad on the unit sphere?
>
> 2. I would like to triangulate the sphere based on the solution {rad} so
> that the mesh is denser where the rad is higher.
>
> Any suggestions are highly appreciated.
> Thanks,
> --Ted
>
>
>
>


Ted,

this should get you started:

Needs["TetGenLink`"]

(* generate some points, you have those *)
nn = 1000;
dlong = \[Pi]*(3 - Sqrt[5]);
dz = 2/nn;
long = 0;
z = 1 - dz/2;
pts = Table[r = Sqrt[1 - z*z]; val = {Cos[long]*r, Sin[long]*r, z};
z = z - dz; long = long + dlong; val, {i, 0, nn - 1}] // N;


inInst = TetGenCreate[]
TetGenSetPoints[inInst, pts]
outInst = TetGenTetrahedralize[inInst, ""]
coords = TetGenGetPoints[outInst];
(* +1 bug in TetGen *)
surface = TetGenGetFaces[outInst] + 1;


cf = ColorData["DarkRainbow"];
(* your rad should be the values *)
values = Rescale[Range[Length[coords]] // N];
vc = Developer`ToPackedArray@(List @@@ (cf[#] & /@ values));

(*visualize*)
Graphics3D[
GraphicsComplex[coords, Polygon[surface], VertexColors -> vc],
Boxed -> False]

Graphics3D[{Specularity[1, 50], EdgeForm[],
GraphicsComplex[coords, Polygon[surface], VertexColors -> vc]},
Boxed -> False, Lighting -> "Neutral"]


Hope this helps,

Oliver




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.