Advertisement
here2share

# deg2xy.py

Nov 6th, 2022 (edited)
1,219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. # deg2xy.py
  2.  
  3. from math import sin, cos, radians
  4.  
  5. def deg2xy(angle, r):
  6.     a = radians(angle)
  7.     return (round(sin(a) * r, 9) , round(cos(a) * r, 9))
  8.  
  9. n = 1000
  10. for degrees in range(360):
  11.     x,y = deg2xy(degrees, n)
  12.     print (degrees,x, y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement