import math # The list called red is a list of varying strengths of red (all values # need to be between 0 and 1. Similarly for green and blue. red = [] green = [] blue = [] # Stroke size is the width of the stroke, set when calling set_parameters() stroke_size = 0.1 # These are the x,y coordinates of the start and end of the brush stroke. start_x = 2 start_y = 3 end_x = 5 end_y = 3 # Each stroke is implemented by drawing circles. num_circles = 0 def set_parameters(x1, y1, x2, y2, size): global start_x, start_y, end_x, end_y, stroke_size start_x = x1 start_y = y1 end_x = x2 end_y = y2 stroke_size = size def compute_num_circles(): # Note: we need to state our intent to modify a global: global num_circles # Write your code here to compute the number of circles needed # Compute the distance between start point and end point. Then # divide by the stroke size. The minimum is one circle. def get_num_circles(): return num_circles def make_red_stroke_colors(start_r, end_r, g, b): # Look through and understand how we're computing all # the intermediate red values between start_r and end_r. # And how the lists for red, green, blue are being built. global red, green, blue d = (end_r - start_r) / num_circles red = [] green = [] blue = [] for i in range(num_circles): red.append(start_r + i*d) green.append(g) blue.append(b) def make_green_stroke_colors(r, start_g, end_g, b): # Write your code here def make_blue_stroke_colors(r, g, start_b, end_b): # Write your code here