Search code examples
androidmathseekbar

Invert SeekBar values and with a logarithmic / exponential scale


I want a SeekBar that meets the following requirements:

min = -655
half = -140
max = 0

Following the next explanation I've managed to have

min = 0
half = 140
max = 655

I am halfway there but I don't know how to have the numbers inverted..


Solution

  • Take the expression you came up with, and reflect it horizontally around x=.5 by replacing x with 1-x. Then reflect it vertically around y=0 by negating the whole thing.

    That is, you have f(x), but you want g(x) where g(x) = -f(1-x).