Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #!/usr/bin/env python
  2. """ Plot a circle with """
  3.  
  4. import math
  5. import matplotlib.pyplot as plt
  6.  
  7.  
  8. def main():
  9. """ Plot """
  10. radius = 120
  11. x_points = []
  12. y_points = []
  13.  
  14. for second in range(60):
  15. angle = (360 / 60) * second
  16. xangle = 90 - angle
  17.  
  18. x_point = radius + (math.cos(math.radians(xangle)) * radius)
  19. y_point = radius + (math.sin(math.radians(xangle)) * radius)
  20.  
  21. x_points.append(x_point)
  22. y_points.append(y_point)
  23.  
  24. plt.plot(x_points, y_points, "ro")
  25. plt.axis([-10, 250, -10, 250])
  26. plt.show()
  27.  
  28.  
  29. if __name__ == "__main__":
  30. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement