Try now in the
Open Cloud »
(no sign-in required)

Heart and Flower Curves

Use polar plots to make natural-looking shapes.

Run the code to make a heart-like (cardioid) plot. Try values other than 0.5for example, 1 or 4:

SHOW/HIDE DETAILS

PolarPlot plots curves in polar coordinates.

This plots the path of a point that has a constant distance of 1 unit from the origin as an angle sweeps from 0 to 360 degrees:

In[1]:=
X
Out[1]=

Drag the slider to see how the curve is plotted:

Out[1]=

This plots the path of a point whose distance from the origin is proportional to the angle:

In[2]:=
X
Out[2]=

Drag the slider to see how this curve is plotted:

Out[2]=

This plots a heart shape (cardioid):

In[3]:=
X
Out[3]=

Drag the slider to see how the cardioid is plotted:

Out[3]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Allow the parameter to change. Drag the slider to get different shapes:

Hint: press (Windows) or (Mac) while dragging the slider for fine adjustment.


Note: click the + to the right of the slider to see the value of the parameter.

SHOW/HIDE DETAILS

Add a slider to control the value of the parameter with Manipulate.

Replace the parameter 0.5 with the variable n, wrap the PolarPlot expression with Manipulate, and specify that n varies from 0 to 10, with an initial value of 0.5. Now you can drag the slider to change the value of the parameter:

In[1]:=
X
Out[1]=

Add a plot range to keep the plot from jumping around as you drag the slider:

In[2]:=
X
Out[2]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Make the curve thick and red. Try other colors, like Blue or Green:

Hint: color names are capitalizedfor example, Purple, Gray, and Green.

SHOW/HIDE DETAILS

PolarPlot normally draws a blue curve:

In[1]:=
X
Out[1]=

You can change the color of the curve with PlotStyle:

In[2]:=
X
Out[2]=

Make the curve thicker with AbsoluteThickness. If there is more than one style element, put the elements in a list ({}):

In[3]:=
X
Out[3]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Share ItMake an interactive website for exploring heart and flower curves:

SHOW/HIDE DETAILS

Deploy the Manipulate to the Wolfram Cloud where anyone with a browser can use it:

In[1]:=
X
Out[1]=

Click the link in the output to visit the site.

Share the link by right-clicking it and choosing Copy Address. Paste the link into an email, tweet, or other message.

HIDE DETAILS
In[1]:=
X
Out[1]=