Question

How can I make a polar contour plot in Maxima? Given an expression such as

exp(-r) * cos(phi)

I'd like to plot contours in the x-y plane which have the same value of the expression at all points along the contour.

I've tried

draw3d(cylindrical(exp(-r) * cos(phi), r, 0, 5, phi, 0, 2*%pi), contour=map))

but cylindrical plots r as a function of z and phi, not z as a function of r and phi. It would be nice to not have to convert manually to Cartesian coordinates.

Was it helpful?

Solution

contour_plot(exp(-r)*cos(phi), [r,0,2], [phi, 0, 2*%pi], [transform_xy, polar_to_xy],
[gnuplot_preamble, "set cntrparam levels 10;"]);

The polar_to_xy option interprets the first two variables as distance from the z axis and azimuthal angle.

OTHER TIPS

What is the problem using something like

draw3d(explicit(20*exp(-x^2-y^2)-10,x,0,2,y,-3,3),
   contour_levels = 15,
   contour        = map,
   surface_hide   = true) ;

I think that in that case is straigthforward to do it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top