On Tue, Aug 26, 2008 at 6:05 PM, William Stein <[EMAIL PROTECTED]> wrote:
>
> On Tue, Aug 26, 2008 at 2:59 AM, Philippe Saade <[EMAIL PROTECTED]> wrote:
>>
>> Hi
>>
>> I quickly browsed sage-support and the wiki. Sorry for duplicates
>>
>> What is the prefered way to restrict real precision in a cell,
>> worksheet or @interact.
>>
>> I modified @interact example with a slider but the numbers have to
>> many digits so the Latex output is ugly...
>
> You should coerce the numbers to have last digits or use e.g., %.2f in
> a format string to truncate all but the last two digits. Without posting
> a more precise example it is difficult to give you any better advice.
>
> Your idea to "restrict real precision in a cell" doesn't make sense in the
> context of Sage, though it would make sense in a system like matlab.
> It's just not how sage works.
>
Sorry, i wasn't precise enough (not joking ;-)
If you try the following example, i think you will understand my
problem :-) if you move x0 a little bit and the order too.
var('x')
f = sin(x)*e^(-x)
p = plot(f,-1,5, thickness=2)
@interact
def DLpoint_variable(order=slider(1,12,step_size=1,label='Ordre :'),
x0=slider(0,4,0.1,default=0)):
dot = point((x0,f(x0)),pointsize=80,rgbcolor=(1,0,0))
ft = f.taylor(x,x0,order)
pt = plot(ft,-1, 5, color='green', thickness=2)
html('$f(x)\;=\;%s$'%latex(f))
html('$\hat{f}(x;%s)\;=\;%s+\mathcal{O}(x^{%s})$'%(x0,latex(ft),order+1))
show(dot + p + pt, ymin = -.5, ymax = 1)
Philippe
> William
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---