Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
bias & gain for VEX short ver
float bias(float b; float x) {
return pow(x, log(b)/log(0.5));
float gain(float g; float x) {
return (x<0.5) ? bias(1-g, 2*x)*.5 : 1-bias(1-g, 2-2*x)*.5;
// usage example
float x = v@P.x;
//v@P.y = bias(0.8, x);
v@P.y = gain(0.3 , x);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.