MathGroup Archive 2003

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

Search the Archive

Re: Numerical description of a contour

  • To: mathgroup at smc.vnet.net
  • Subject: [mg38780] Re: Numerical description of a contour
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Sun, 12 Jan 2003 06:16:58 -0500 (EST)
  • References: <avjgd1$6ug$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Nicolas,

I hope that the following will provide the data that you need

For ContourPlot

    expr = x^2 + y^2;

    cg = ContourPlot[expr, {x, -1, 1}, {y, -1, 1},
    ContourShading -> False];

The data here is a matrix of heights from which contour lines and contour
shading is constructed, so convert the contour graphics into graphics which
includes the contour lines explicitely.

    gr = Graphics[cg];

Extract the coordinates in the lines and add to each point {u,v} the value
of expr for these values of x and y.

    cl = Cases[Graphics[cg], Line[lst_] :>
     (lst /. {u_Real, v_Real} -> {u, v, expr /.
         {x -> u, y -> v}}), Infinity];

This may do more than you need - note that the values of expr only
approximate the intended contour height and that you can avoid adding the
values if you plot the contour lines separately for specified heights.

Anyway let's check:

Show[Graphics3D[{Line /@ cl}]]



For ContourPlot3D

    << "Graphics`ContourPlot3D`"

No conversion is needed, and I will plot just one contour surface:

    gr3 = ContourPlot3D[x*y*z, {x, -1, 1}, {y, -1, 1}, {z, -1, 1},
Contours -> {0.1}]

Extract the lists of points defining the polygons that make up the displayed
surface.

    Cases[gr3, Polygon[lst_] :> lst, Infinity]


Allan

---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565



"Nicolas Fressengeas" <fresseng at ese-metz.fr> wrote in message
news:avjgd1$6ug$1 at smc.vnet.net...
> Dear Netters,
>
> In trying to analyse my 3D data with Mathematica, I want to visualize an
> iso-surface. That is nicely done with ContourPlot in 2D and ContourPlot3D
in
> 3D. My aim is now to get a numerical description of these surfaces in
order
> to do them some numerical treatment.
>
> Any one to help me out ?
>
> Thanks in advance
>
> Nicolas
> --
> ______________________________________________________
> Dr. Nicolas Fressengeas
> http://www.ese-metz.fr/~fresseng
> Supélec / Laboratoire Matériaux Optiques, Photonique et Systèmes
> 2 rue E.Belin, 57070 METZ Cedex
> Tel: +33 387 764 705 ... Fax: +33 387 764 700
> Plan d'accès:http://www.mappy.com/PlanPerso/fresseng/1
>
>
>




  • Prev by Date: RE: "Autoload in AddOns" doesn't load?
  • Next by Date: RE: Replace Function & Application!!!
  • Previous by thread: Re: Numerical description of a contour
  • Next by thread: inverse laplace transform of products / convolution