Define a function drawCircle. This function should expect a Turtle object, the coordinates of the circle’s center point, and the circle’s radius as argu- ments. The function should draw the specified circle. The algorithm should draw the circle’s circumference by turning 3 degrees and moving a given distance 120 times. Calculate the distance moved with the formula 2.0 * p * radius / 120.0

Respuesta :

Answer and Explanation:

As the function contain Turtle Object, and coordinates of the circle center points and radius.

def draw Circle (turtle obj, center-point, radius):

>>>Circumference at 120 distance

   circumference = 2 * 3.14 * (radius/120)

>>>call the turtle method

 turtle.up()

>>>as the coordinates point x and y is at -1 position.

(x,y) = center point[-1]

   turtle.turn

>>>>as turtle moving given distance of 120

turtle.moving(120)

turtle.down()

turtle=Turtle()

drawCircle(turtle, [(20,20)], 20)

ACCESS MORE