매개변수 방정식

245 days ago by namy0727

t = var('t') R = RealField(8) t0 = -2; t1 = 4 dt = (t1-t0)/10; dt = R(dt) @interact def para_curv(f=input_box(t^2 - 2*t, label='x =', type=SR), g=input_box(t + 1, label='y =', type=SR), tpoint = slider(t0,t1,dt, default=t0)): pretty_print(html('$$x = %s, \quad y = %s$$'%(latex(f),latex(g)))) init = t0 tpt = tpoint p = point((f(t=init),g(t=init)), color='red', size=20) p+= text('$t = %s$'%(init), (f(t=init)+0.2,g(t=init)+0.2), color='red', fontsize=15) min_x = find_local_minimum(f,t0,t1)[0] max_x = find_local_maximum(f,t0,t1)[0] min_y = find_local_minimum(g,t0,t1)[0] max_y = find_local_maximum(g,t0,t1)[0] if tpt == init: p.show(xmin = min_x, xmax = max_x, ymin = min_y, ymax = max_y, aspect_ratio=1) else: p+= parametric_plot((f, g), (t,init,tpt),rgbcolor = (1,0,0)) R = RealField(8) p+= point((f(t=tpt),g(t=tpt)), color='red', size=20)+text('$t = %s$'%(R(tpt)), (f(t=tpt)+0.2,g(t=tpt)+0.2), color='red', fontsize=15) p.show(xmin = min_x, xmax = max_x, ymin = min_y, ymax = max_y, aspect_ratio=1) 
       
x = 
y = 
tpoint 

Click to the left again to hide and once more to show the dynamic interactive window

t = var('t') t0 = 0; t1 = 2*pi dt = (t1-t0)/8; @interact def model_para1(tpoint = slider(t0,t1,dt, default=t0)): f = cos(t) g = sin(t) pretty_print(html('$$x = %s, \quad y = %s$$'%(latex(f),latex(g)))) init = t0 tpt = tpoint p = point((f(t=init),g(t=init)), color='red', size=20) p+= text('$t = %s$'%(init), (f(t=init)+0.2,g(t=init)+0.2), color='red', fontsize=15) min_x = find_local_minimum(f,t0,t1)[0] max_x = find_local_maximum(f,t0,t1)[0] min_y = find_local_minimum(g,t0,t1)[0] max_y = find_local_maximum(g,t0,t1)[0] if tpt == init: p.show(xmin = min_x, xmax = max_x, ymin = min_y, ymax = max_y, aspect_ratio=1) else: p+= parametric_plot((f, g), (t,init,tpt),rgbcolor = (1,0,0)) R = RealField(8) p+= point((f(t=tpt),g(t=tpt)), color='red', size=20)+text('$t = %s$'%(R(tpt)), (f(t=tpt)+0.2,g(t=tpt)-0.2), color='red', fontsize=15) p.show(xmin = min_x, xmax = max_x, ymin = min_y, ymax = max_y, aspect_ratio=1) 
       

Click to the left again to hide and once more to show the dynamic interactive window

t = var('t') t0 = 0; t1 = 2*pi dt = (t1-t0)/16; @interact def model_para2(tpoint = slider(t0,t1,dt, default=t0)): f = sin(2*t) g = cos(2*t) pretty_print(html('$$x = %s, \quad y = %s$$'%(latex(f),latex(g)))) init = t0 tpt = tpoint p = point((f(t=init),g(t=init)), color='red', size=20) p+= text('$t = %s$'%(init), (f(t=init)+0.2,g(t=init)+0.2), color='red', fontsize=15) min_x = find_local_minimum(f,t0,t1)[0] max_x = find_local_maximum(f,t0,t1)[0] min_y = find_local_minimum(g,t0,t1)[0] max_y = find_local_maximum(g,t0,t1)[0] if tpt == init: p.show(xmin = min_x, xmax = max_x, ymin = min_y, ymax = max_y, aspect_ratio=1) elif tpt<=pi: p+= parametric_plot((f, g), (t,init,tpt),rgbcolor = (1,0,0)) R = RealField(16) p+= point((f(t=tpt),g(t=tpt)), color='red', size=20)+text('$t = %s$'%(R(tpt)), (f(t=tpt)+0.2,g(t=tpt)-0.2), color='red', fontsize=15) p.show(xmin = min_x, xmax = max_x, ymin = min_y, ymax = max_y, aspect_ratio=1) elif tpt>pi: p+= parametric_plot((f, g), (t,init,tpt),rgbcolor = (1,0,0)) init = pi p+= parametric_plot((f, g), (t,init,tpt),rgbcolor = (0,0,1)) R = RealField(16) p+= point((f(t=tpt),g(t=tpt)), color='red', size=20)+text('$t = %s$'%(R(tpt)), (f(t=tpt)+0.2,g(t=tpt)-0.2), color='blue', fontsize=15) p.show(xmin = min_x, xmax = max_x, ymin = min_y, ymax = max_y, aspect_ratio=1) 
       

Click to the left again to hide and once more to show the dynamic interactive window

t = var('t') R = RealField(8) @interact def para_family(a = slider(-2,2,R(0.5),-2)): f = a + cos(t) g = a*tan(t) + sin(t) pretty_print(html('$$x= a + \cos t, \\quad y= a \\tan t + \sin t, \\quad 0 \leq t \leq 2 \pi$$')) p = parametric_plot((f, g), (t,0, 2*pi), rgbcolor = (1,0,0)) if a < 0: p+= text('$a = %s$'%(R(a)), (2,2), rgbcolor=(0,0,0), fontsize=15) else: p+= text('$a = %s$'%(R(a)), (-2,2), rgbcolor=(0,0,0), fontsize=15) p.show(xmin = -4, xmax = 4, ymin = -4, ymax = 4) 
       

Click to the left again to hide and once more to show the dynamic interactive window