def get_mandlebrot_escape_values(width, height):
 x_vals = np.linspace((-3), 2, width)
 y_vals = np.linspace((-1.5), 1.5, height)
 grid = np.meshgrid(x_vals, y_vals)
 v_get_num_escape_turns = np.vectorize(get_num_escape_turns)
 return v_get_num_escape_turns(*grid).astype(np.float)

def get_mandlebrot_escape_values ( width , height ) : x_vals = np . linspace ( ( - 3 ) , 2 , width ) y_vals = np . linspace ( ( - 1.5 ) , 1.5 , height ) grid = np . meshgrid ( x_vals , y_vals ) v_get_num_escape_turns = np . vectorize ( get_num_escape_turns ) return v_get_num_escape_turns ( * grid ) . astype ( np . float )
constructs the mandlebro set for a grid of dimensions parameters width: int width of the resulting grid height: int height of the resulting grid returns a grid of floating point values containing the output of get_num_escape_turns function for each point .