CoCalc Public FilesAIMS-2017-TorusPlots.sagews
Views : 35
Description: AIMS-2017-Torus plots
Compute Environment: Ubuntu 18.04 (Deprecated)
def geodesictorusplot(A,B):
a = polygon2d([(0,0), (1,0), (1,1), (0,1)], color='orange')
R = RealField(53)
def f(x):
x = R(x)
return [x  - floor(x), A*x+B - floor(A*x+B)]
v = [f(x) for x in [0, .001,..,30]]
b = points(v, zorder=10, size = 3)
return(show(a + b, frame=True, gridlines=True))
geodesictorusplot(.123051,0)

def circletorusplot(T):
a = polygon2d([(0,0), (1,0), (1,1), (0,1)], color='orange')
R = RealField(53)
def f(x):
x = R(x)
return [T*cos(x) - floor(T*cos(x)), (T*sin(x)) - floor(T*sin(x))]
v = [f(x) for x in [0, .001,..,7]]
b = points(v, zorder=10, size = 5)
return(show(a + b, frame=True, gridlines=True))
circletorusplot(.5)

def spiraltorusplot(A,B,S):
a = polygon2d([(0,0), (1,0), (1,1), (0,1)], color='orange')
R = RealField(53)
def f(x):
x = R(x)
return [A*exp(B*x)*cos(S*(x))+.7-A - floor(A*exp(B*x)*cos(S*(x))+.7-A), (A*exp(B*x)*sin(S*(x)))+.5 - floor(A*exp(B*x)*sin(S*(x))+.5)]
v = [f(x) for x in [0, .001,..,1.36]]
b = points(v, zorder=10, size = 5)
return(show(a + b, frame=True, gridlines=True))
spiraltorusplot(0.16, 2, 20)


def skewgeodesictorusplot(A,B,s):
a = polygon2d([(0,0), (1,0), (1+s,1), (s,1)], color='orange')
R = RealField(53)
def f(x):
x = R(x)
return [x  - floor(x-s*(A*x+B))-s*floor(A*x+B), A*x+B - floor(A*x+B)]
v = [f(x) for x in [0, .001,.., 5]]
b = points(v, zorder=10, size = 3)
return(show(a + b, frame=True, gridlines=True))
skewgeodesictorusplot(0.7,0.9,0)