Guest User

Untitled

a guest
Apr 19th, 2020
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. from turtle import Turtle
  2. from numpy import cos, sin, pi
  3.  
  4. t = Turtle()
  5. t.speed(2)
  6.  
  7. t.shape('turtle')
  8.  
  9. def pol2dec(r: float, phi: float) -> tuple:
  10. x = r * cos(phi)
  11. y = r * sin(phi)
  12. point = (x, y)
  13. print("point= ", point)
  14. return point
  15.  
  16.  
  17. vMin = 1
  18. vMax = 200
  19.  
  20. radius, radius_inc = 0, 0.5
  21. angle, angle_inc = 0, 2 * pi / 20
  22. for vc in range(vMin, vMax + 1):
  23. radius += radius_inc
  24. angle += angle_inc
  25. t.goto(*pol2dec(radius, angle))
Advertisement
Add Comment
Please, Sign In to add comment