I am trying to simulate a slider on a webpage that behaves non-linearly as shown in the illustration below.

I want to generate a mathematical formula that can represent these states and also give all values in between. I thought this looked like something I can achieve with a log formula, but I could not produce a formula that works.

enter image description here


You can achieve this with an exponential function.

First define $x$ as a percentage on the slider.

$f(x)=100\times (\sqrt[50]10)^x$

If we evaluate $\sqrt[50]10$, we get:

$f(x)=100\times 1.047129^x$

When $x=50$, $f(50)=1000$. When $x=0$, $f(0)=100$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.