MathGroup Archive 2001

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

Search the Archive

RE: Cylidrical Coordinates Plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg27914] RE: [mg27860] Cylidrical Coordinates Plot
  • From: "David Park" <djmp at earthlink.net>
  • Date: Fri, 23 Mar 2001 04:31:44 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Easy with the DrawingPaper package, available at my web-site below.

There are two routines there that aid in the process - FineGrainPolygons and
DrawingTransform.

Here is a function of polar coordinates.

f[r_, \[Theta]_] := (1 - r)Sin[\[Theta]]

First I use ContourDraw, which extracts the primitive graphics from
ContourPlot and works just like it, to make a contour plot with theta and r
as the x and y axis.

I then use FineGrainPolygons on this output to breakup the straight line
segments on the boundary of the plot into shorter line segments. This is
necessary because DrawingTransform is going to bend the curves in the polar
theta-r plane into curves in the Cartesian x-y plane. Lines must be made up
of many points to bend properly. In the code below, any two points separated
by a distance greater than 0.1 are broken in to 10 points.

I then use DrawingTransform to transform the lines from the theta-r plane to
the x-y plane. Voila! We have a nice circular plot of the function.

Needs["Graphics`DrawingPaper`"]

Show[Graphics[{FineGrainPolygons[ContourDraw[f[r, \[Theta]], {\[Theta], 0,
2*Pi},
        {r, 0, 1}, PlotPoints -> 50, ColorFunction -> Hue], 0.1, 10] /.
      DrawingTransform[Function[{\[Theta], r}, r*Cos[\[Theta]]],
       Function[{\[Theta], r}, r*Sin[\[Theta]]]]}], AspectRatio ->
Automatic,
   PlotRange -> All, Background -> Linen, Frame -> True,
   FrameLabel -> {x, y}, PlotLabel -> f[r, \[Theta]], ImageSize -> 500];

I wish I could show the plot.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

> -----Original Message-----
> From: Moranresearch at aol.com [mailto:Moranresearch at aol.com]
To: mathgroup at smc.vnet.net
> Sent: Thursday, March 22, 2001 4:30 AM
> To: mathgroup at smc.vnet.net
> Subject: [mg27914] [mg27860] Cylidrical Coordinates Plot
>
>
> How can I make z = f(r,theta)  contour, density and 3D plots in
> Mathematica?
> Thanks.
>



  • Prev by Date: Re: Memory leak
  • Next by Date: Re: How to find the equidistance curves of a curve defined by Interpolation function?
  • Previous by thread: Re: Cylidrical Coordinates Plot
  • Next by thread: Random number generation