Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5672

Puzzling behaviour of ListContoutPlot3D

From "Tony Harker" <a.harker@ucl.ac.uk>
Newsgroups comp.soft-sys.math.mathematica
Subject Puzzling behaviour of ListContoutPlot3D
Date 2011-10-16 11:12 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j7ee67$eiu$1@smc.vnet.net> (permalink)

Show all headers | View raw


  Having struggled to understand why a real-world application was giving me
puzzling output from ListContourPlot3D, I boiled the problem down to the
following reduced cases. First, a simple spherically symmetrical cases in
the interval -1 to 1 in each dimension, with data given either as a grid of
values or as a list of {x,y,z,f} values:

 

fn[{x_, y_, z_}] := Sqrt[x^2 + y^2 + z^2]

grid = Table[{x, y, z}, {x, -1, 1, .2}, {y, -1, 1, .2}, {z, -1,   1, .2}];

ListContourPlot3D[Map[fn, grid, {3}], Contours -> {.5}]

ListContourPlot3D[Map[Flatten[{#, fn[#]}] &, Flatten[grid, 2]],  Contours ->
{.5}]

 

  Both plots give closed surfaces, but although the underlying values are
the same the first plot is nearer to spherical than the second. Why the
difference?

 

Then I tried a different range of values:

 

fn[{x_, y_, z_}] := Sqrt[(x - 6)^2 + (y - 6)^2 + (z - 6)^2]

grid = Table[{x, y, z}, {x, 1, 11}, {y, 1, 11}, {z, 1, 11}];

ListContourPlot3D[Map[fn, grid, {3}], Contours -> {5}]

ListContourPlot3D[Map[Flatten[{#, fn[#]}] &, Flatten[grid, 2]],  Contours ->
{5}]

 

  Again, the first plot was nice and spherical. This time, though, the
second plot did not even produce a closed surface. In the real problem I was
originally tackling, half the surface octants were missing and half were
present, but here the  amount of surface that shows is not so neatly
classifiable. What's happening?

 

In[473]:= $Version

 

Out[473]= "8.0 for Microsoft Windows (64-bit) (February 23, 2011)"

 

   Tony

 

A.H. Harker
Department of Physics and Astronomy

University College London
Gower Street
London
WC1E 6BT

Tel: (within UK)    020 7679 3404
     (overseas ) +44 20 7679 3404
E:    a.harker@ucl.ac.uk

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Puzzling behaviour of ListContoutPlot3D "Tony Harker" <a.harker@ucl.ac.uk> - 2011-10-16 11:12 +0000

csiph-web