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(2)
- t.shape('turtle')
- def jump2next(pt: tuple):
- t.penup()
- t.goto(pt)
- t.pendown()
- def pol2dec(r: float, phi: float) -> tuple:
- x = r * cos(phi)
- y = r * sin(phi)
- point = (x, y)
- print("x = ", x)
- print("y = ", y)
- return point
- vMin = 1
- vMax = 22
- radius = 40
- angle, angle_inc = 3 * pi / 2, pi / 10
- for j in range(vMin, vMax + 1):
- jump2next(pol2dec(radius, angle))
- angle += angle_inc
- t.goto(*pol2dec(radius, angle))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement