Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Implement a canvas that draws red lines around all four edges, blue lines at the horizontal and vertical midpoints, and green lines across the

1. Implement a canvas that draws red lines around all four edges, blue lines at the horizontal and vertical midpoints, and green lines across the diagonals.

image text in transcribed

2. Implement a canvas that draws the pattern shown below, with lines fanning out from the top-left corner:I suggest using a loop. One approach is to divide the width and height into a number of equal steps (I used 15 for mine). The lines all start at coordinates (0,0). The endpoint of the first line is the bottom-left corner. Each successive lines endpoint is one step further horizontally and one step less vertically.

image text in transcribed

3. Extend your canvas to draw the lines fanning out from all four corners, as shown below:Note that if you do it right, you need to do very little additional computation since all four patterns are symmetrical. The starting points are easythink about the endpoints.

image text in transcribed

4. Implement a canvas that draws the pattern shown below:The first line starts in the top-left corner and ends at the bottom one step over to the right. The second line starts one step down, and ends one step farther right. And so on.

image text in transcribed

5. Extend your canvas to draw the pattern in all four corners, as shown below:As before, this is not hard if you think about the symmetries

image text in transcribed

6. Implement a canvas that draws 12 concentric circles at its center, as shown below:The innermost circle should have a radius of 10 pixels, and each successive circle should have a radius 10 pixels larger than the previous one. The circles should have different colors, or alternate colors, or cycle through colors (which is what I did above).

image text in transcribed

BasicLines

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions