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 pol2dec(r: float, phi: float) -> tuple:
- x = r * cos(phi)
- y = r * sin(phi)
- point = (x, y)
- return point
- vMin = 3
- vMax = 13
- a = 10
- for n in range(vMin, vMax + 1):
- angle = 0
- radius = 0
- angle_inc = ( 360 / n ) / 2
- radius_inc = angle_inc / (2 * sin(360 / 2 * n))
- angle += angle_inc
- radius += radius_inc
- print("++++++block++++++")
- print("n = ", n)
- print("angle = ", angle)
- print("radius = ", radius)
- print("++++++block++++++")
- for i in range(n):
- t.goto(*pol2dec(radius, angle))
Advertisement
Add Comment
Please, Sign In to add comment