def task_3_2(): fig = tuple(itr.islice(dr.gen_triangle(), 10)) n = len(fig) fig1 = tuple(map(dr.tr_rotate, fig, [0] * n, [0] * n, [2] * n)) dr.plot(fig) dr.plot(fig1) dr.show()
def task_3_4(): fig = tuple(itr.islice(dr.gen_triangle(), 10)) n = len(fig) fig1 = tuple(map(dr.tr_homothety, fig, [0] * n, [0] * n, [-1] * n)) dr.plot(fig) dr.plot(fig1) dr.show()
def task_6_3(): n = 30 first_line = list(itr.islice(dr.gen_hexagon(), n)) second_line = list(itr.islice(dr.gen_hexagon(), n)) first_line = list( map(dr.tr_rotate, first_line, [20] * n, [0] * n, [math.pi / 150] * n)) second_line = list( map(dr.tr_rotate, second_line, [20] * n, [0] * n, [-math.pi / 150] * n)) first_line = list(map(dr.tr_translate, first_line, [0] * n, [-0.5] * n)) dr.plot(first_line) dr.plot(second_line) dr.show() dr.clean() for figure in first_line: second_line = list( filter(lambda x: not dr.flt_polygon_angles_inside(figure, x), second_line)) dr.plot(first_line) dr.plot(second_line) dr.show() dr.clean()
def task_3_1(): fig = tuple(itr.islice(dr.gen_triangle(), 10)) n = len(fig) fig1 = tuple(map(dr.tr_translate, fig, [5] * n, [5] * n)) dr.plot(fig) dr.plot(fig1) dr.show()
def task_2_4(): a = tuple(itr.islice(dr.gen_triangle(), 2)) a = tuple(map(dr.tr_translate, a, [0] * 2, [1.5] * 2)) b = tuple(itr.islice(dr.gen_hexagon(), 3)) c = tuple(itr.islice(dr.gen_rectangle(), 3)) c = tuple(map(dr.tr_translate, c, [0] * 3, [-1.5] * 3)) dr.plot(a) dr.plot(b) dr.plot(c) dr.show()
def task_4_4(): fig = tuple(itr.islice(dr.gen_rectangle(), 10)) n = len(fig) fig = tuple(map(dr.tr_rotate, fig, [0] * n, [0] * n, [math.pi / 4] * n)) fig1 = tuple(map(dr.tr_homothety, fig, [0] * n, [0] * n, [2] * n)) fig1 = tuple(map(dr.tr_symmetry, fig1, [0] * n, [0] * n, [-1] * n, [1] * n)) dr.plot(fig) dr.plot(fig1) dr.show()
def task_4_3(): n = 3 first_line = list(itr.islice(dr.gen_triangle(), n)) second_line = list(itr.islice(dr.gen_triangle(), n)) second_line = list( map(dr.tr_symmetry, second_line, [0] * n, [1.1] * n, [1] * n, [1.1] * n)) dr.plot(first_line) dr.plot(second_line) dr.show() dr.clean()
def task_4_2(): n = 10 first_line = list(itr.islice(dr.gen_rectangle(), n)) second_line = list(itr.islice(dr.gen_rectangle(), n)) first_line = list( map(dr.tr_rotate, first_line, [13] * n, [0.35] * n, [math.pi / 4] * n)) second_line = list( map(dr.tr_rotate, second_line, [13] * n, [0.5] * n, [-math.pi / 4] * n)) first_line = list(map(dr.tr_translate, first_line, [0] * n, [5] * n)) dr.plot(first_line) dr.plot(second_line) dr.show() dr.clean()
def task_2_3(): fig = tuple(itr.islice(dr.gen_hexagon(), 10)) dr.plot(fig) dr.show()
def task_2_2(): fig = tuple(itr.islice(dr.gen_triangle(), 10)) dr.plot(fig) dr.show()
def task_2_1(): fig = tuple(itr.islice(dr.gen_rectangle(), 10)) dr.plot(fig) dr.show()