# Math question

-hh hh at livecode.org
Fri Feb 26 15:27:50 EST 2016

```> Kay C. wrote:
> But then again I failed English so maybe I completely misunderstood what
> Peter was trying to achieve with his slider. :-(

@Kay C.
I didn't want to critisize you with my answer, sorry.

Of course you are correct with the "rounding", he said he can "vary the
events by 1 second", sorry. So he should use
round(c*f(..))
with my solution too, because that *gets* the thumbpos.

clear for me what he really wants:

@Peter
Could you please go more in detail.

You have a scrollbar of width 200,
startValue -300 (or -5*60),
endValue 300 (or 5*60).
What is your target output for example at -300, -60, 60 and 300
and some other values in between? What numbers do you wish to see
there?

Possibly you are thinking of a scrollbar that varies it's thumbs
units. Say for example, if the width of your scrollbar is 200:

from left to left+40 divides into -5*60 to -2*60
= 180 units scaled to width 40
from left+40 to left+160 divides into -2*60 to 2*60
= 240 units scaled to width 120
from left+160 to left+200=right divides into 2*60 to 5*60
= 180 units scaled to width 40

This would scale the **INPUT** (=the x-axis), what is possible
to achieve, but you then have to script your own "showValue" field.

The current approaches of Kay and me scale the **OUTPUT** (= y-axis),
usually quite different.

@Kay C.
Do you agree with that second possible interpretation?

hh

```