Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3.  
  4. def cannabola(theta):
  5. return (1+np.sin(theta))*(1-0.9*abs(np.sin(4*theta)))*(0.9+0.05*np.cos(200*theta))
  6.  
  7. def plot_polar():
  8. start=0
  9. end=2*np.pi
  10. theta = np.linspace(start, end, 1000)
  11. r = list(map(cannabola, theta))
  12. ax = plt.subplot(111, polar=True)
  13. ax.plot(theta, r,color="green")
  14. ax.set_rticks([])
  15. ax.grid(True)
  16. plt.show()
  17.  
  18. plot_polar()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement