Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from turtle import Turtle
- from numpy import cos, sin, pi
- t = Turtle()
- t.speed(1)
- t.shape('turtle')
- def pol2dec(r: float, phi: float) -> tuple:
- '''
- x = r * cos(phi * pi / 180)
- y = r * sin(phi * pi / 180)
- angle += angle_inc
- '''
- x = r * cos(phi)
- y = r * sin(phi)
- point = (x, y)
- print("x = ", x)
- print("y = ", y)
- return point
- vMin = 1
- vMax = 23
- radius = 40
- angle, angle_inc = 0, pi / 10
- for j in range(vMin, vMax + 1):
- angle += angle_inc
- if j == 1:
- print("radius = ", radius)
- print("angle = ", angle)
- t.goto(*pol2dec(0, angle))
- else:
- t.goto(*pol2dec(radius, angle))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement