Polar Plot

Did you already complete the PyTamaro iconParametric Plot activity? If not, complete it before moving on.

Our plot library contains a function to plot polar curves. A polar curve is defined by a polar function, a function that maps an angle to a radius:

radius = f(angle)

The first parameter of polar_plot expects the polar function.

The second parameter expects a range of angles for which to plot points.

polar_plot will call the polar function for each angle, to determine the radius at that angle. Then it will produce a point at that polar coordinate (radius, angle).

Circle

Let's use polar_plot to plot points along a circle.

The polar function for a circle must produce the same radius no matter what angle. Let's pick the radius 100, and lets plot points for the angles 0 to pi/2.

Loading...
Loading...

Cardioid

Let's draw a curve that looks a bit like a heart!

Note that the polar function we define here returns different radii for different angles. Thus, we don't get a circle, but a polar curve where the radius varies.

Loading...

Heart

This more complex polar function produces a curve that looks a bit more like a heart than the cardioid function:

Loading...

Lemniscate

Here is a curve that looks a bit like the infinity sign:

Loading...

Garfield

And this curve looks like Garfield :)

Loading...

Cannabis

This curve is kind of illegal.

Loading...

Archimedean Spiral

This one is simple and nice: thanks to Archimedes. The radius grows linearly with the angle.

To get multiple windings we need to use a range greater than 2 * pi.

Loading...

Radial Sine Wave

The following curve could be useful as an outline of some icon.

Loading...

Polar Rose

Loading...

More Curves

The above polar curves can be found on MathWorld. There are more. You may want to try them out.

Or you may want to try out the plots in the PyTamaro iconLissajous Plot activities.


This activity has been created by LuCE Research Lab and is licensed under CC BY-SA 4.0.

Polar Plot

Logo of PyTamaro

PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI

Privacy PolicyPlatform Version c30aa49 (Tue, 25 Nov 2025 16:55:08 GMT)