Interactivo

113 days ago by Alex_

 
       
 
       
 
       
q=x**2-9*x*3 @interact def _(a=(1,4), b=(0,10)): show(plot(a*q, (x,-4,4)), figsize=5) 
       

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

#muestra un polinomio de grado n,con coeficientes enteros de valor absoluto menor a m, para el cual varía el coeficiente director y el término constante def polira(n,m): var('x') l=[] p=1 S=1 for i in range (1,n+1): t=ceil(random()*m) s=random() if s<0.5: S=-1 # S asignará el signo de la raíz, aleatoriamente t=S*t # este será la nueva raíz del polinomio l.append(t) p=p*(x-t) q=expand(p) # genera el polinomio expandido return q 
       
polira(9,6) 
       
x^9 + 26*x^8 + 276*x^7 + 1474*x^6 + 3479*x^5 - 2748*x^4 - 39996*x^3 -
106704*x^2 - 129600*x - 62208
x^9 + 26*x^8 + 276*x^7 + 1474*x^6 + 3479*x^5 - 2748*x^4 - 39996*x^3 - 106704*x^2 - 129600*x - 62208
q=x^3+x**2 #fijo un polinomio para trabajar @interact def _(a=(-10..10),b=(-10..10)): show(plot(a*sin(1/x)+b, (x,-20,20), ymin=-20, ymax=20,figsize=6)) 
       

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

@interact def _(a=5, y=(0..20)): print a + y 
       

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

@interact(layout={'top': [['a', 'b']], 'left': [['c']], 'bottom': [['d']]}) def _(a=x^2, b=(0..20), c=100, d=x+1): print a+b+c+d 
       

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

#html("It is relatively easy to make a demonstration of limit of (sinx)/x") x=var('x') f(x)=(sin(1/x))#/x base=5 @interact def _(Zoom=(1..50)): p = plot(f,xmin=-(base**Zoom),xmax=base**Zoom, thickness=1) show(p) 
       
Zoom 

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

@interact def _(c = color_selector((0, .5, 0))): show(plot(sin ,(-2*pi,2*pi), color = c)) 
       

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

 
       
@interact def _(a=input_box('sage', label="Enter your name", type=str)): print "Hello there %s"%a.capitalize() 
       
Enter your name 

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

p=x**x-3*x type(p) 
       
<type 'sage.symbolic.expression.Expression'>
<type 'sage.symbolic.expression.Expression'>
@interact def _(v = input_box((1,0,0))): show(plot(sin,(-2*pi,2*pi),color=v)) 
       

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

@interact(layout={'top': [['a', 'b']], 'left': [['c']], 'bottom': [['d']]}) def _(a=input_box(2), b=(0..20), c=100, d=x+1): 
       

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