ex334.py

import numpy as np
import matplotlib.pyplot as plt
plt.axes(projection = 'polar')
# creating an array
# containing the angle values
rads = np.arange(0,(2*np.pi),0.1)
a=6
# plotting the cardioid
for rad in rads:
    r = a*(1 + np.cos(rad)) 
    plt.polar(rad,r,'ro',markersize=4)  
plt.savefig('ex334.png', dpi=72)
plt.show()

Discover more from Tips and Hints for Aerospace Engineers

Subscribe now to keep reading and get access to the full archive.

Continue reading