java - Logarithmic Mouse Movement -


OK, this would probably be a simple question to answer. I did not have a mathematical class with Logrimad in some years, so I apologize. So I have a USB controller that I use using the left joystick to control the mouse on the screen. Now how it works, the controller doubles between 0.00 and 1.00, depending on how far the joystick is in the direction (0.00 center, 1.00 pushed all the way). I use it to adjust the speed of the mouse motion movement, which by multiplying the returned value at a given speed (double * speed returned) it gives me a linear motion, but the accuracy of the mouse and the things on the screen For the purpose of clicking, I want to consider it more logarithmic, so when it is hard to slow down, and then the speed increases when you move joystick Number way you can get good speed to go on the screen, while slowly gaining running good sensitivity. So I need help with the formula, because I'm sure it's very easy. Besides, I am working in Java. Right now my formula is:

  double value (value given by controller) int speed = 25; Value + = value * speed;  

Then I use this to move the mouse. Thank you, Brayden

I think you mean exponential an exponential function: more Value is , for the same change in the derived large (more speed in value will increase).

Double Values ​​= ...; Int Base = 25; Value = java.lang.Math.pow (base, value);

Ensure that if java.lang.Math is required in its entirety or you have to import java.lang.Math Needs or Not First I'm not a Java programmer.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -