Search All of the Math Forum:

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

 Oliver Ruebenkoenig Posts: 237 Registered: 6/28/08
Re: Is there SphericalListPlot3D?
Posted: Mar 29, 2012 3:57 AM

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:

(* 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