import numpy as np from util.graph import Graph A = np.array([ [1, 0.2], [0, 1] ]) F = np.array([ [1, 1, 2, 2, 1.4, 1.4, 2, 2, 1.4, 1.4], [1, 3, 3, 2.6, 2.6, 2, 2, 1.6, 1.6, 1] ]) g = Graph() g.add_shape(F) result = A @ F print(result) g.add_shape(result, color="tab:blue") g.show()
import numpy as np from util.graph import Graph A = np.array([[1, 3, 1], [1, 1, 3]]) g = Graph() g.add_shape(A) I = np.identity(2) IA = I @ A g.add_shape(IA, color='tab:blue') g.show()
import numpy as np from util.graph import Graph A = np.array([[1, 2, 2, 1], [2, 2, 4, 4]]) B = np.array([[4, 4, 4, 4], [0, 0, 0, 0]]) C = np.array([[0, 1], [-1, 0]]) D = np.array([[-1, 0], [0, 1]]) g = Graph() g.add_shape(A) g.add_shape(A - B, color="tab:blue") g.add_shape(3 * A, color="tab:green") g.add_shape(C @ A, color="tab:orange") g.add_shape(D @ A, color="tab:purple") g.show()
import numpy as np from util.graph import Graph A = np.array([[1, 0.5], [0, 1]]) L = np.array([[1, 1, 1.5, 1.5, 2, 2], [2, 4, 4, 2.5, 2.5, 2]]) print(L) g = Graph() g.add_shape(L) L2 = A @ L g.add_shape(L2, color='tab:blue') print(L2) g.show()