Created
October 16, 2019 00:05
-
-
Save cosinekitty/fa4bac12aaadac5976e9e34e41d5065e to your computer and use it in GitHub Desktop.
Calculate 360 points equally spaced around a unit circle.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import math | |
angle = math.radians(1) | |
a = math.cos(angle) | |
b = math.sin(angle) | |
x = 1.0 | |
y = 0.0 | |
for n in range(361): | |
print('{:3d} {:11.8f} {:11.8f}'.format(n, x, y)) | |
x, y = (a*x - b*y), (a*y + b*x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is the output of this program: