How to initialize a screen to a given size How to use an image as your background How to move the turtle to a given (x, y) position without drawing a line on the screen How to draw a circle, how to draw a square (we covered some of this in class) How to draw filled-in shapes with begin_fill() How to clear the screen after drawing In Python, the center of the screen is at (0, 0) by default. Your program should do the following: Draw a square with a length of 80. The center of your square should be at (0, 0). Use any color you want; in the example screen captures here, I’m using blue. Draw an inscribed circle in the square that was drawn in step 1. Use a different color for your circle. I used magenta but pick any color you like – other than what you used for your square. Due to the way Turtle draws lines and circles, you’ll likely need to experiment with your starting coordinates for your circle draw.   Prompt the user for a new (x, y) coordinate for the square, and a new (x, y) coordinate for the circle. “Move” the shapes to their new positions by erasing the original square and circle, and drawing them in the location specified by the user. The redrawn shapes should be solid-filled with the color of your choice (the shapes’ center-points are specified by the information input by the user). Define any functions you need to make this all work. The “app window” is screen capture I saved to a png file, so your drawings might be a pixel or two shifted. That’s okay as long as the placement and movement seem reasonable from the (0, 0) origin you start at. You can assume the user gives you “good data”: values all within the Turtle coordinate system between 200 and -200. Notes: Consider the given .png image of the application window is 970x635 pixels, and that should be the starting size of your Turtle screen. If you don’t remember your geometry, an inscribed circle looks like this, and the diameter is equal to the length of the square’s side. Tips: It’s very difficult to test graphics-related functions without explicit test tools (screen-grabbers, functional test tools, etc.), so your most important job is to ensure your turtle movement and drawing is as consistent as possible. Of note, when you move the turtle, it has a directional heading (N/S/E/W). Take care to set the heading consistently to ensure repeatable drawing of the shapes. You can trust the user to give you good information, and to stay within the ±200 (the default bounds of the drawing canvas coordinates)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
  • How to initialize a screen to a given size
  • How to use an image as your background
  • How to move the turtle to a given (x, y) position without drawing a line on the screen
  • How to draw a circle, how to draw a square (we covered some of this in class)
  • How to draw filled-in shapes with begin_fill()
  • How to clear the screen after drawing

In Python, the center of the screen is at (0, 0) by default.

Your program should do the following:

  1. Draw a square with a length of 80. The center of your square should be at (0, 0). Use any color you want; in the example screen captures here, I’m using blue.
  2. Draw an inscribed circle in the square that was drawn in step 1. Use a different color for your circle. I used magenta but pick any color you like – other than what you used for your square. Due to the way Turtle draws lines and circles, you’ll likely need to experiment with your starting coordinates for your circle draw.  
  3. Prompt the user for a new (x, y) coordinate for the square, and a new (x, y) coordinate for the circle.
  4. “Move” the shapes to their new positions by erasing the original square and circle, and drawing them in the location specified by the user. The redrawn shapes should be solid-filled with the color of your choice (the shapes’ center-points are specified by the information input by the user).

Define any functions you need to make this all work. The “app window” is screen capture I saved to a png file, so your drawings might be a pixel or two shifted. That’s okay as long as the placement and movement seem reasonable from the (0, 0) origin you start at.

You can assume the user gives you “good data”: values all within the Turtle coordinate system between 200 and -200.

Notes:

  • Consider the given .png image of the application window is 970x635 pixels, and that should be the starting size of your Turtle screen.
  • If you don’t remember your geometry, an inscribed circle looks like this, and the diameter is equal to the length of the square’s side.

Tips:

  • It’s very difficult to test graphics-related functions without explicit test tools (screen-grabbers, functional test tools, etc.), so your most important job is to ensure your turtle movement and drawing is as consistent as possible. Of note, when you move the turtle, it has a directional heading (N/S/E/W). Take care to set the heading consistently to ensure repeatable drawing of the shapes.
  • You can trust the user to give you good information, and to stay within the ±200 (the default bounds of the drawing canvas coordinates)

 

• Filenames: align_draw.py (and any other files you need)
File
Edit
View
Help
CS 5001 Align Draw
• Starter file:
(0,0)
Note: If you're having trouble downloading the starter file (it's the graphic image above called shape_window.png) right-click on the image and select "Save
image As.." to save it on your local device.
• Starter file
Open image in New Tab
Seve image A.
Copy Iage
Cepy Image Address
Create OR Cede for this imge
Search Geegle for Image
Emej Symbols
Linde
Cut
All programmers need to be able to get the hang of a new library or learn someone else's code. With this last HW2 problem, we'll get some
practice with that -- with a Python graphics library called Turtle.
Use the Python Turtle library to render the supplied background image that looks a bit like an application window. Read up on the Turtle
documentation in the Programming in Context textbook (starting around chapter 1.5, and it's scattered throughout a few other chapters as well).
You can also check out the Python documentation e. Here are a few things you might want to look up:
Transcribed Image Text:• Filenames: align_draw.py (and any other files you need) File Edit View Help CS 5001 Align Draw • Starter file: (0,0) Note: If you're having trouble downloading the starter file (it's the graphic image above called shape_window.png) right-click on the image and select "Save image As.." to save it on your local device. • Starter file Open image in New Tab Seve image A. Copy Iage Cepy Image Address Create OR Cede for this imge Search Geegle for Image Emej Symbols Linde Cut All programmers need to be able to get the hang of a new library or learn someone else's code. With this last HW2 problem, we'll get some practice with that -- with a Python graphics library called Turtle. Use the Python Turtle library to render the supplied background image that looks a bit like an application window. Read up on the Turtle documentation in the Programming in Context textbook (starting around chapter 1.5, and it's scattered throughout a few other chapters as well). You can also check out the Python documentation e. Here are a few things you might want to look up:
Here's what my "app window" looks like after drawing the square and inscribed circle
Python Turtle Graphics
File Edit View Help
CS 5001 Align Draw
(0,0)
After being asked for new coordinates, here's what my "app window" looks like after the shapes have "moved"
Python Turtle Graphics
CS 5001 Align Draw
File
Edit
View
Help
(0,0)
DI
III
Transcribed Image Text:Here's what my "app window" looks like after drawing the square and inscribed circle Python Turtle Graphics File Edit View Help CS 5001 Align Draw (0,0) After being asked for new coordinates, here's what my "app window" looks like after the shapes have "moved" Python Turtle Graphics CS 5001 Align Draw File Edit View Help (0,0) DI III
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
JQuery and Javascript
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education