Question

Instructions ircle.py+ 1 2 3 Define a function drawCircle . This function should expect a Turtle object, the coordinates of the circles center point, and the circles radius as arguments. The function should draw the specified circle. The algorithm should draw the circles circumference by turning 3 degrees and moving a given distance 120 times. Calculate the distance moved with the formula 2.0 x π x radius +120.0 Define a function main that will draw a circle with the following parameters when the program is run: ·X-25 ·Ys 75 Radius-100

python version 3

0 0
Add a comment Improve this question Transcribed image text
Answer #1

import turtle

import math

def drawCircle(t,x,y,r):

t.penup()

t.goto(x,y+r)

t.pendown()

dis=(2.0*(math.pi)*r)/120.0

for i in range(120):

t.forward(dis)

t.right(3)

turtle.done()

t=turtle.Turtle()

drawCircle(t,25,75,100)

1 import turtle 2 import math 3 def drawcircle(t,x,y,r): 4 t.penup() t.goto(x,y+r) t.pendown() dis-(2.0(math.pi)r)/120.0 for i in range(120): 7 t.forward(dis) t.right(3) 10 turtle.done() 12 13 t-turtle.Turtle() 14 drawCircle(t,25,75,100) 15 16 17

Add a comment
Know the answer?
Add Answer to:
python version 3 Instructions ircle.py+ 1 2 3 Define a function drawCircle . This function should...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Define a function drawcircle . This function should expect a Turtle object, the coordinates of the...

    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 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 × π × radius ÷ 120.0. Define a function main that will draw a circle with the following parameters when the program...

  • Hello! This is C++. Q3. Write a program Define a Super class named Point containing: An...

    Hello! This is C++. Q3. Write a program Define a Super class named Point containing: An instance variable named x of type int. An instance variable named y of type int. Declare a method named toString() Returns a string representation of the point. Constructor that accepts values of all data members as arguments. Define a Sub class named Circle. A Circle object stores a radius (double) and inherit the (x, y) coordinates of its center from its super class Point....

  • I he following formula gives the distance between two points (x1, yl) and (02, y2) in...

    I he following formula gives the distance between two points (x1, yl) and (02, y2) in the Cartesian plane The main0 function is provided. You should implement the following functions: sqrt [ (x2-x1), (y2-yl) 1. Fi ndRadius... ): This function takes as its parameter four numbers that represent the center and a point on the circle, finds and returns the circle's radius. 2 CircleCalculations(....: This function takes as its parameter a number that represents the radius of the circle and...

  • Must be done in python. This will be connected to other turtle assignments. Might need a...

    Must be done in python. This will be connected to other turtle assignments. Might need a sleep at end. Swimming in a Pond In this function, you will draw a small pond and have the turtle first take a nice walk around it and then jump in. The pond will need to be drawn in the upper left quandrant of your screen. This function needs to do the following: Contain two parameters to denote the color of the path (pen...

  • Task 5 Write a function called “earring_iter” that takes two integer arguments, size and count. This...

    Task 5 Write a function called “earring_iter” that takes two integer arguments, size and count. This function should use a (for or while) loop to draw a Hawaiian earring containingcount-manycircles,wherethefirstcircledrawnhassizesize,andeachsubsequent circle has size earring_ratio times the size of the previous circle. Here is a recursive specification for drawing a Hawaiian earring of a given size: • To draw a Hawaiian earring of a given size with zero hoops, do nothing. • To draw a Hawaiian earring of a given size...

  • Python 3.5 Code Part A: 10 points A tick is a short line that is used...

    Python 3.5 Code Part A: 10 points A tick is a short line that is used to mark off units of distance along a line. Write a function named drawTick() that uses a turtle parameter to draw a single tick of specified length perpendicular to the initial orientation of the turtle. The function drawTick() takes two parameters: 1. a turtle, t, that is used to draw 2. an integer, tickLen, that is the length of the tick When drawTick() is...

  • python programming Question 29 10 pts (SHORT ANSWER) Define a function named display_pattern that is a...

    python programming Question 29 10 pts (SHORT ANSWER) Define a function named display_pattern that is a void function with no parameters. When the function is called, it should use a nested loop to to display the symbol # in 2 rows and 3 columns as follows: ### ### BI V A - A - I E33 x x, E V GT 12pt Paragraph

  • please use python thanks will rate!! x + Run C Code Validate Implement the function step_random_walk_20(x_coords,...

    please use python thanks will rate!! x + Run C Code Validate Implement the function step_random_walk_20(x_coords, Y_coords) below, which should take two arrays of equal length containing the x-andy- coordinates for some number of particles. We'll use a very simple random walk algorithm • For each particle, choose a random angle between 0 and 2 • The particle moves by 1 unit of distance in the direction given by d.o. It is displaced by (Ax, Ay) (cos, sino). We'll do...

  • Python 3 Define a function below, get_subset, which takes two arguments: a dictionary of strings (keys)...

    Python 3 Define a function below, get_subset, which takes two arguments: a dictionary of strings (keys) to integers (values) and a list of strings. All of the strings in the list are keys to the dictionary. Complete the function such that it returns the subset of the dictionary defined by the keys in the list of strings. For example, with the dictionary ("puffin": 5, "corgi": 2, "three": 3) and the list ("three", "corgi"), your function should return {"corgi": 2, "three"...

  • Python 1 Write a function called sum_odd that takes two parameters, then calculates and returns the...

    Python 1 Write a function called sum_odd that takes two parameters, then calculates and returns the sum of the odd numbers between the two given integers. The sum should include the two given integers, if they are odd. You can assume the arguments will always be positive integers, and the first smaller than or equal to the second. 3 To get full credit on this problem, you must define at least 1 function, use at least 1 loop, and use...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT