works with any x, y values for the left thumbstick. And resolves polarity shifts for max values. INV on calculator for cos-¹( and multiply first if incorrect paranthesis.
Sorry I'm not very bright, what is this for? To drive a car with thumbstick? Is it for special needs? Where does this code run? Is it on an Arduino or something like that? Pretty cool if you're helping out someone to drive with special needs.
arduino sounds cool, I was thinking more about software. As most people already have a gamepad with x and y values output on left thumbstick. all racing games have 180 degree steering accuracy on the left thumbstick. 90 left and 90 right. with this code one can transpose all x and y values of the left thumbstick to allow for 360 degree of steering accuracy. 180 degrees left and 180 degrees right. Utilizing the full rotational capacity of the left thumbstick. (or right thumbstick if one wants to) It can be used if someone has special needs. If it helps. Maybe if someone can't use a steering wheel for some reason. Maybe this helps. But I don't know about that. It depends per person. But it is intended for everyone actually, to have 200% steering accuracy on a gamepad or joystick, left thumbstick. And it also prevents max steering polarity shifts at max rotations.
either developers write this in coding language of the game. Or it can be used on a third party software and translated back to x values in any game. But I don't know any coding language, so I can't make the third party software. Nor do I know if it is allowed to use such a third party software that enhances the gamepads capabilities for racing games. But it would definitely be nice if someone can make a third party software that integrates these codes into a workable format or executable. I know someone who made such a software but it works only on truck simulator. I have no idea how can make it work on automobilista 2, except if someone can make a third party software that includes these functions into an executable gamepad steering enhancer.