MathGroup Archive 2003

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

Search the Archive

Re: Pick up coordinates along different contours.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg43390] Re: Pick up coordinates along different contours.
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Fri, 29 Aug 2003 07:15:50 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <bihpbq$b5t$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

suppose you need the lines from fun[]

fun[x_, y_] := Cos[Sqrt[x^2 + y^2]]
gr = Graphics[
    ContourPlot[fun[x, y], {x, -2Pi, 2Pi}, {y, -2Pi, 2Pi}, 
      Contours -> {-1/2, 1/2}, PlotPoints -> 30, DisplayFunction ->
Identity]]

one generates the contour graphics and convert it to an ordinary
Graphics[] with lines now you wish to select all lines, that include
points {x,y} with Abs[f[x,y]-level]< eps

level = 1/2;
dta = Select[Cases[gr, _Line, Infinity], 
      And @@ ( # < 0.05 & /@  (Abs[fun @@ # - level] &  /@ First[#] ))
&];
Show[Graphics[dta, AspectRatio -> 1]];
 
eps (here 0.05) should be not too small because ContourPlot[] is not
very accurate ..

Regards
  Jens



Jun Lin wrote:
> 
> I plot a couple of 2D contours by using ContourPlot. Now, I want to
> pick up the coordinate of each point along each contour for next step
> calculation purposes. I appreciate with your any suggestion of how to
> get the coordinates of each point along a specific contour (suppose
> two contours have been created).
> 
> Jun


  • Prev by Date: Re: Pattern Matching Problem
  • Next by Date: Re: Summation w/ Functions
  • Previous by thread: Pick up coordinates along different contours.
  • Next by thread: RE: Pick up coordinates along different contours.