The Little Guy Posted November 8, 2012 Share Posted November 8, 2012 I have been developing an android app, and I am stuck on some math (One thing I am not too good with). So, I have a slide bar that you can drag left to right. By Default all the way left is 0 and all the way right is 100. I am trying to find a formula that will make all the way left will simulate -100 and all the way right will simulate +100 and 0 would be dead center. For those not familiar with android programming, the event passes a position value to the event listener, which is a number between 0 and 100. I would like to take that number and convert it from -100 to +100. Thanks for the help! Quote Link to comment https://forums.phpfreaks.com/topic/270459-some-simple-math/ Share on other sites More sharing options...
The Little Guy Posted November 8, 2012 Author Share Posted November 8, 2012 Got the formula! f(x) = x*2 - 100 Quote Link to comment https://forums.phpfreaks.com/topic/270459-some-simple-math/#findComment-1391086 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.