On Sunday, June 8, 2014 9:40:42 AM UTC-7, Андрей Ширшов wrote: > > TypeError: unable to convert x (=floor(tan(abs(1/2*pi + > alpha)^0.220000000000000))) to an integer >
The problem is that "fibonacci" isn't a symbolic function, so when you give it an argument, it wants to evaluate it to an integer immediately. The polar-plot thing never comes in: sage: fibonacci(floor(tan((abs(alpha+pi/2)^0.22)))) TypeError: unable to convert x (=floor(tan(abs(1/2*pi + alpha)^0.220000000000000))) to an integer Plot functions also accept python-callables as arguments (as long as they have a way of getting their data points, they're happy), so the following does work: sage: polar_plot(lambda alpha:(1+cos(fibonacci(floor(tan((abs(alpha+pi/2)^0.22)))))), (alpha, -pi/2, pi/2)) Alternatively, you could use the closed formula for the fibonacci sequence as a symbolic expression and work with that: sage: fib(n)=(((1+sqrt(5))/2)^n-((1-sqrt(5))/2)^n)/sqrt(5) sage: polar_plot((1+cos(fib(floor(tan((abs(alpha+pi/2)^0.22)))))), (alpha, -pi/2, pi/2)) -- 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/d/optout.
