Ask Your Question

Jeff Ford's profile - activity

2018-04-06 12:58:06 -0600 received badge  Self-Learner (source)
2018-04-06 12:58:06 -0600 received badge  Teacher (source)
2015-04-06 19:01:49 -0600 commented answer Rendering a torus in Tachyon

I think you're right. I've been able to use the tachyon viewer, but I'm trying to animate a series of nested tori, and was hoping to control tachyon directly. I've got the animation without it, but it would be nice to change the view and lighting.

2015-04-05 19:23:15 -0600 commented question "Too many output messages"

It's happened to me as well.

2015-04-05 18:57:06 -0600 asked a question Rendering a torus in Tachyon

I'm trying to figure out how to render a torus using Tachyon. The problem is that a solid torus requires a 2 variable parametric equation, and it seems Tachyon only likes to use single variable parametric equations. Is there a way around this?

2015-03-31 15:35:36 -0600 answered a question Preserving aspect ratio in animation

I incorporated the suggestions and worked the bounds into two different loops. Seems to have fixed it.

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 [(2*4**n + 4**n*cos(u))*cos(v), (2*4**n + 4**n*cos(u))*sin(v)+c(n), 4**n*sin(u)]
    else:
        return [4**n*sin(u), (2*4**n + 4**n*cos(u))*sin(v)+c(n),  (2*4**n + 4**n*cos(u))*cos(v)]
T0 = []
for i in srange(0,2*pi+0.1, 0.1):
    T0.append(parametric_plot3d(torus(0,u,v), (u,0,2*pi),(v,i, i+0.1), aspect_ratio=1, frame=False, axes=False))

T = []    
for i in range(len(T0)):
    T.append(sum(T0[j] for j in range(i)))

a = animate(T)
a.show()
2015-03-30 16:35:13 -0600 received badge  Editor (source)
2015-03-30 16:34:56 -0600 asked a question 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 [(2*4**n + 4**n*cos(u))*cos(v), (2*4**n + 4**n*cos(u))*sin(v) + c(n), 4**n*sin(u)]
    else:
        return [4**n*sin(u), (2*4**n + 4**n*cos(u))*sin(v) + c(n),  (2*4**n + 4**n*cos(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()
2015-01-04 16:07:50 -0600 commented question Adding arrows in vector fields

It does seem to work in a local copy of Sage, but not in the online viewer

2015-01-03 07:18:54 -0600 commented question Adding arrows in vector fields

Here's the full code

x,y,z,r,delta = var('x','y','z','r','delta')

epsilon = 400 delta = epsilon/400

h=spline([(0,0),(delta,1),(delta/2,1/2),(delta/4,1/8),(3delta/4,7/8),(delta/100,0),(99delta/100,1)])

def f(r): if r >=0 and r <=2delta: return 1 elif r>=2delta and r<= 3delta: return h(3delta-r) elif r>=3delta and r<=4delta: return 0

def g(z): if z >=0 and z <= delta: return 0 elif z >= delta and z<=2delta: return h(z-delta) elif z>=2delta and z<=3delta: return h(3delta-z) elif z>=3delta and z<=4delta: return (-1)h(abs(3delta-z)) elif z>=4delta and z<=5delta: return (-1)h(abs(z-5delta)) elif z>=5delta and z<=6delta ... (more)

2015-01-01 23:15:13 -0600 received badge  Student (source)
2015-01-01 12:01:48 -0600 asked a question Adding arrows in vector fields

I'm using plot_vector_field3d, and I'm not getting any arrows at the ends of the vectors. The documentation seems to indicate this would be automatic. Is there something I'm missing?