subject

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 arguments. The function should draw the specified circle. The pen color should be changed to yellow before drawing a circle and the width of the pen to 5 pixels. 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*n*radius/120.0.

Fill in the circle with blue color. After drawing the circle, hide the turtle.

import turtle

import math

def drawCircle(centerpoint, radius):

degree = 3

count = 0

centerpoint = (2.0 * math. pi * radius / 120)

t. home()

t. setheading(degree)

while count <= 120:

t. down()

t. forward(2.0 * math. pi * radius / 120)

t. up()

degree += 3

t. setheading(degree)

count += 1

drawCircle(centerpoint, radius)

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 23:30, artursino
Me2540 week 5 assignment what do i want to know?
Answers: 1
image
Computers and Technology, 23.06.2019 00:30, hannahrasco4051
Pl i need the answer now ! which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
image
Computers and Technology, 24.06.2019 14:30, ari313
Two students are discussing the flow of electricity. student a says that voltage is a measure of the amount of electron flow in a circuit. student b says that power is the product of voltage and current. which of the following statements is correct? a. only student a is correct b. only student b is correct c. both of the two students are correct d. neither of the two students is correct
Answers: 1
image
Computers and Technology, 24.06.2019 22:00, josephvcarter
Is the process of organizing data to reduce redundancy. a. normalization b. primary keying c. specifying relationships d. duplication
Answers: 1
You know the right answer?
Define a function drawCircle.

This function should expect a Turtle object, the coordina...

Questions in other subjects:

Konu
Mathematics, 10.03.2020 17:00