# on importe les paquets necessaires
import matplotlib.pyplot as plt
import numpy as np
#on definit un tableau des valeurs entre -pi/3 et 5pi/3 (et 213 points intermediaires)
theta=np.linspace(-np.pi/3,5*np.pi/3,213)
#les abscisses et ordonnees
x=(1+2*np.cos(3*theta))*np.cos(theta)
y=(1+2*np.cos(3*theta))*np.sin(theta)
# on dessine la courbe
plt.plot(x,y)
# on dessine deux points qui peuvent interesser le lecteur en rouge et bleu
th1=2*np.pi/9
plt.plot((1+2*np.cos(3*th1))*np.cos(th1),(1+2*np.cos(3*th1))*np.sin(th1),'xr')
th2=np.pi/6
plt.plot((1+2*np.cos(3*th2))*np.cos(th2),(1+2*np.cos(3*th2))*np.sin(th2),'xb')
plt.axis('equal')
# on dessine les axes
plt.plot([-3.5,3.5],[0.,0.],'r-')
plt.plot([0.,0.],[-3.5,3.5],'r-')
# et on fait tout afficher
plt.show()
