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/twinDragon3D.sagews
Views: 1233
A = matrix([[0,0,2],[1,0,1],[0,1,-1]]) D = '[[0,0,0],[1,0,0]]' def Dn(D,A,k): ans = [] for d in Tuples(D, k): s = sum(A^n*d[n] for n in range(k)) ans.append(s) return ans @interact def f(A = matrix([[0,0,2],[1,0,1],[0,1,-1]]), D = '[[0,0,0],[1,0,0]]', k=(3..15), labels=True): print "Det = ", A.det() D = matrix(eval(D)).rows() print "D:" print D G = point3d([v.list() for v in Dn(D,A,k)], size=8)#, opacity=.85) if labels: G += sum([text3d(str(v),v) for v in Dn(D,A,k)]) show(G, axes=False, frame=False)
Interact: please open in CoCalc