# What function plots this?

1. Nov 2, 2008

### rsq_a

This is both a question about the function used to plot AND how to plot the function (I'm interested in keeping the contour/level lines the same):

This looks like a simple f(x,y) = 1/(xy) function. But how would I get Maple/Matlab to plot the contours as shown?

http://science.nasa.gov/headlines/y2005/images/gpb/vortex1_crop.jpg [Broken] one I have no idea. Any idea how its plot can be generated?

Last edited by a moderator: May 3, 2017
2. Nov 2, 2008

### HallsofIvy

I don't see any great difference between the two.

First, they are 3 dimensional and, second, they have circular symmetry so it is best to use cylindrical coordinates. The first is not "1/xy" but you are right to think it looks like 1/x, rotated around the z-axis. Use "r", not x. z= -1/r will give a graph like that. Without more specific information about the graph, z= -1/r2, z= -1/r3, etc. all look the same. If you want them in Cartesian coordinates, use $r= \sqrt{x^2+ y^2}$. Then they are $z= -1/\sqrt{x^2+ y^2}$, $z= -1/(x^2+ y^2)$, $z= -1/(x^2+ y^2)^{3/2}$, etc.l

3. Nov 2, 2008

### N468989

try this:

[X,Y] = meshgrid([-5:0.2:5]);
Zm=1./sqrt(X.^2+Y.^2);
surf(X,Y,-Zm);