I am using the mouse position for a script but the value is between 0 and 1. This means that the center of the screen is 0.5,0.5. The top left is 0,0. The bottom right is 1,1. I need to change these to be values between -1 and 1. So the center would be 0,0. The top left would be -1,-1. The bottom right would remain 1,1. How can I do this?
I found a solution to my problem
x = (x * 2) + -1 y = (y * 2) + -1
This could also be written as
x = (((x - OldMin) * (NewMax - NewMin))/ OldMax - OldMin) + NewMin y = (((y - OldMin) * (NewMax - NewMin))/ OldMax - OldMin) + NewMin