Contact Us!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: sagemathinc/cocalc-example-files
Path: blob/master/sage/interact/Fractals/twinDragon.sagews
Views: 1231
A = matrix([[1,1],[-1,1]]) D = [vector([0,0]), vector([1,0])] @interact def f(A = matrix([[1,1],[-1,1]]), D = '[[0,0],[1,0]]', k=(3..17)): print "Det = ", A.det() D = matrix(eval(D)).rows() def Dn(k): ans = [] for d in Tuples(D, k): s = sum(A^(-n)*d[n] for n in range(k)) ans.append(s) return ans G = points([v.list() for v in Dn(k)]) show(G, frame=True, axes=False)
Interact: please open in CoCalc