On 09/12/2013 10:14 PM, Jotace wrote:
Hi all,
I'm trying to do an interact to illustrate the curvature of a curve
given by y=f(x).
Here is the code, but at the end I cannot properly show the function
k(x). What's wrong? What should I do?
var('x')
f(x)=x^4-2*x^2
@interact
def _(f=input_box(x^4-2*x^2, width=15, label="$f(x)=$"),a=input_box(-2,
width=5, label="$a=$"),b=input_box(2, width=5, label="$b=$")):
Cf=plot(f,x,-2,2,color='blue', thickness=3)
k(x)=abs(diff(f,x,2))/(1+(diff(f,x,1))^2)^(3/2)
Ck=plot(k,x,-2,2,color='red', thickness=3)
show(Cf+Ck,figsize=6)
html('La fonction de courbure est', latex(k))
Thanks!
JC
Try pretty_print instead of html:
pretty_print('La fonction de courbure est', latex(k))
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.