Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- """ Plot a circle with """
- import math
- import matplotlib.pyplot as plt
- def main():
- """ Plot """
- radius = 120
- x_points = []
- y_points = []
- for second in range(60):
- angle = (360 / 60) * second
- xangle = 90 - angle
- x_point = radius + (math.cos(math.radians(xangle)) * radius)
- y_point = radius + (math.sin(math.radians(xangle)) * radius)
- x_points.append(x_point)
- y_points.append(y_point)
- plt.plot(x_points, y_points, "ro")
- plt.axis([-10, 250, -10, 250])
- plt.show()
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement