Question
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.
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.
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.
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.
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
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).
BasicLinesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started