# circle_at.py # Use a function to draw circles from turtle import * def circle_at(x, y, r): """Draw circle with center (x, y) radius r.""" penup() goto(x, y - r) pendown() setheading(0) circle(r) circle_at(-200, 0, 20) begin_fill() circle_at(0, 0, 100) end_fill() circle_at(200, 0, 20) hideturtle() exitonclick()
Added by Kathy M.
Close
Step 1
Import the necessary modules. Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 69 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
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 is run: X = 50 Y = 75 Radius = 100 Checks: Python GUI Test Incomplete Program produces the correct output Result
Aarya B.
(Tkinter: two circles intersect?) Using the Circle2D class you defined in Exercise 8.18, write a program that enables the user to point the mouse inside a circle and drag it. As the circle is being dragged, the label displays whether two circles overlap, as shown in Figure 12.18.
(Tkinter: two circles intersect?) Using the Circle2D class you defined in Exercise 8.18, write a program that enables the user to specify the location and size of two circles and displays whether the circles intersect, as shown in Figure 12.20. Enable the user to point the mouse inside a circle and drag it. As a circle is being dragged, the program updates the circle’s center coordinates and its radius in the text fields.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD