In [1]:
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display,Math
In [2]:
print('Rose curves')
display(Math('x = \\cos(kt)\\cos(t)'))
display(Math('y = \\cos(kt)\\sin(t)'))
display(Math('\\text{if} k \\: \\epsilon \\: Z \\begin{cases} k \\: \\text{is  even}, & 2k \\: \\text{petals} \\\ k \\: \\text{is odd}, & k\\: \\text{petals} \\end{cases}'))
Rose curves
$\displaystyle x = \cos(kt)\cos(t)$
$\displaystyle y = \cos(kt)\sin(t)$
$\displaystyle \text{if} k \: \epsilon \: Z \begin{cases} k \: \text{is even}, & 2k \: \text{petals} \\ k \: \text{is odd}, & k\: \text{petals} \end{cases}$
In [3]:
k = 2

t = np.linspace(0,4*np.pi,1000)

x = np.cos(k*t) * np.cos(t)
y = np.cos(k*t) * np.sin(t)

plt.plot(x,y,'m',linewidth=3)
plt.axis('square')
plt.axis('off')
plt.show()

Exercise

In [4]:
fig,ax = plt.subplots(3,3,figsize=(10,6))
row,col = np.indices((3,3))

for i in range(0,9):
    k = i/2
#     print(k)

    x = np.cos(k*t) * np.cos(t)
    y = np.cos(k*t) * np.sin(t)

    r = row.ravel()[i]
    c = col.ravel()[i]
    
    ax[r,c].plot(x,y,'k',linewidth=2)
    ax[r,c].axis('square')
    ax[r,c].axis('off')
    ax[r,c].set_title('k=%s' %k)

plt.show()