Creating an irregular arc with python turtle

Viewed 38

I'm trying to make a function which draws an irregular arc similar to figure 1, instead it has drawn a spiral. I'm not sure how to draw one correctly and there are no functions to do this to my knowledge

Long Arc - Figure 1

import turtle
char = turtle.Turtle()
char.speed(0)
screen = turtle.Screen()
screen.tracer(False)


def draw_arc(length, left_right):
    sx = char.xcor()
    sy = char.ycor()

    def turn(angle):
        if left_right:
            char.left(angle)
        else:
            char.right(angle)
    count = 1.8
    turn(90)
    char.forward(1)
    while char.xcor() != sx and char.ycor() != sy and count >= 0:
        char.forward(1)
        turn(1 * count)
        count -= 0.01


draw_arc(100, True)
screen.update()
turtle.listen()
turtle.mainloop()
1 Answers
import turtle
t = turtle.Pen(visible=False)


t.speed('fastest')
t.left(90)
for x in range(180):
    t.forward(1)
    t.right(1)

add this line and modify it until it fit ur need ( setx() or sety )

    t.setx( x * 1.5)
Related