# Managing variable situation (complex conditional scripting?)

Hi to all,

I'm developing some materials about functions and limits

I would like to build an interactive animation which given a [continuous] function and selecting an x_0 value, could show

- the corresponding limit i.e. as the function is continuous, the output f(x_0)
- an interval on the y axis describing the selected proximity to the limit i.e f(x_0)-e<y<f(x_0)+e
- the corresponding interval on x-axis, which guarantees that x values taken inside it will give an output which is inside the selected range on y axis,

At present moment I managed to get to point 2 (see attached example)

My problem is to find a command or a sequence of commands which can choose the correct intercepts between the function and the two lines corresponding to the extremes of the range on y axis. given the correct intercepts, I could the project them on x-axis and get the desired range on x values.

I would need to choose the two points whose x is nearest to x_0, but I cannot understand whether it is possible to find them using geogebrascript commands, that is with pure sequential programming and without iterations or complex if/then combinations. I gave a look to javascript support but it doesn't look simple either.

Any help or suggestion (or the confirmation that my goal is not reachable) is welcome

thank you in advance!

Ilic

Maybe something like this?

Loading...Comments have been locked on this page!