First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Preserving aspect ratio in animation

I'm trying to animate a series of increasing, nested tori. I'm testing the code for the first one, but the aspect ratio isn't behaving, and axes are showing up. I've tried messing with figsize, to no avail. Suggestions?

u,v = var('u,v') def is_even(n): return n%2 == 0

def c(n): return 2/3*(4^(n+1)-4)

def torus(n,u,v): if is_even(n): return [(24n + 4ncos(u))cos(v), (24n + 4ncos(u))sin(v) + c(n), 4nsin(u)] else: return [4nsin(u), (24n + 4ncos(u))sin(v) + c(n), (24n + 4ncos(u))cos(v)]

T = [] for i in range(10): T.append(parametric_plot3d(torus(0,u,v), (u,0,(i+1)2pi/9), (v,0,(i+1)2pi/9), axes="false"))

a = animate(T) a.show()

click to hide/show revision 2
No.2 Revision

Preserving aspect ratio in animation

I'm trying to animate a series of increasing, nested tori. I'm testing the code for the first one, but the aspect ratio isn't behaving, and axes are showing up. I've tried messing with figsize, to no avail. Suggestions?

u,v = var('u,v') def is_even(n): return n%2 == 0

def c(n): return 2/3*(4^(n+1)-4)

def torus(n,u,v): if is_even(n): return [(24n + 4ncos(u))cos(v), (24n + 4ncos(u))sin(v) + c(n), 4nsin(u)] else: return [4nsin(u), (24n + 4ncos(u))sin(v) + c(n), (24n + 4ncos(u))cos(v)]

T = [] []

for i in range(10): range(10):

T.append(parametric_plot3d(torus(0,u,v), (u,0,(i+1)2pi/9), (v,0,(i+1)2pi/9), axes="false"))

(u,0,(i+1)*2*pi/9), (v,0,(i+1)*2*pi/9), axes="false"))

a = animate(T) a.show()

click to hide/show revision 3
No.3 Revision

Preserving aspect ratio in animation

I'm trying to animate a series of increasing, nested tori. I'm testing the code for the first one, but the aspect ratio isn't behaving, and axes are showing up. I've tried messing with figsize, to no avail. Suggestions?

u,v = var('u,v') def is_even(n): return n%2 == 0

def c(n): return 2/3*(4^(n+1)-4)

def torus(n,u,v): if is_even(n): return [(24n + 4ncos(u))cos(v), (24n + 4ncos(u))sin(v) + c(n), 4nsin(u)] else: return [4nsin(u), (24n + 4ncos(u))sin(v) + c(n), (24n + 4ncos(u))cos(v)]

T = []

for i in range(10):

T.append(parametric_plot3d(torus(0,u,v), (u,0,(i+1)*2*pi/9), (v,0,(i+1)*2*pi/9), axes="false"))

a = animate(T) a.show()

click to hide/show revision 4
No.4 Revision

Preserving aspect ratio in animation

I'm trying to animate a series of increasing, nested tori. I'm testing the code for the first one, but the aspect ratio isn't behaving, and axes are showing up. I've tried messing with figsize, to no avail. Suggestions?

sage: u,v = var('u,v') sage: def is_even(n): sage: return n%2 == 0

def sage:def c(n): sage: return 2/3*(4^(n+1)-4)

def sage:def torus(n,u,v): sage: if is_even(n): sage: return [(24n + 4ncos(u))cos(v), (24n + 4ncos(u))sin(v) + c(n), 4nsin(u)] sage: else: sage: return [4nsin(u), (24n + 4ncos(u))sin(v) + c(n), (24n + 4ncos(u))cos(v)]

sage: T = []

sage: for i in range(10):

range(10):
sage:    T.append(parametric_plot3d(torus(0,u,v), (u,0,(i+1)*2*pi/9), (v,0,(i+1)*2*pi/9), axes="false"))

(u,0,(i+1)2pi/9), (v,0,(i+1)2pi/9), axes="false"))

sage: a = animate(T) sage: a.show()

click to hide/show revision 5
No.5 Revision

Preserving aspect ratio in animation

I'm trying to animate a series of increasing, nested tori. I'm testing the code for the first one, but the aspect ratio isn't behaving, and axes are showing up. I've tried messing with figsize, to no avail. Suggestions?

sage: u,v = var('u,v') sage: def is_even(n): sage: return n%2 == 0

sage:def def c(n): sage: return 2/3*(4^(n+1)-4)

sage:def def torus(n,u,v): sage: if is_even(n): sage: return [(24n + 4ncos(u))cos(v), (24n + 4ncos(u))sin(v) + c(n), 4nsin(u)] sage: else: sage: return [4nsin(u), (24n + 4ncos(u))sin(v) + c(n), (24n + 4ncos(u))cos(v)]

sage: T = []

sage: for i in range(10): sage: T.append(parametric_plot3d(torus(0,u,v), (u,0,(i+1)2pi/9), (v,0,(i+1)2pi/9), axes="false"))

sage: a = animate(T) sage: a.show()

click to hide/show revision 6
No.6 Revision

updated 10 years ago

kcrisman gravatar image

Preserving aspect ratio in animation

I'm trying to animate a series of increasing, nested tori. I'm testing the code for the first one, but the aspect ratio isn't behaving, and axes are showing up. I've tried messing with figsize, to no avail. Suggestions?

u,v = var('u,v')
def is_even(n):
    return n%2 == 0

0

def c(n): return 2/3*(4^(n+1)-4)

2/3*(4^(n+1)-4)

def torus(n,u,v): if is_even(n): return [(24n [(2*4**n + 4ncos(u))cos(v), (24n 4**n*cos(u))*cos(v), (2*4**n + 4ncos(u))sin(v) 4**n*cos(u))*sin(v) + c(n), 4nsin(u)] 4**n*sin(u)] else: return [4nsin(u), (24n [4**n*sin(u), (2*4**n + 4ncos(u))sin(v) 4**n*cos(u))*sin(v) + c(n), (24n (2*4**n + 4ncos(u))cos(v)]

4**n*cos(u))*cos(v)]

T = []

[]

for i in range(10): T.append(parametric_plot3d(torus(0,u,v), (u,0,(i+1)2pi/9), (v,0,(i+1)2pi/9), axes="false"))

(u,0,(i+1)*2*pi/9), (v,0,(i+1)*2*pi/9), axes="false"))

a = animate(T) a.show()

a.show()