Saturday 31 August 2013

Signing a value

y = 2(x) -1

Turn 0 - 1 into -1 - 1.

Sometimes, you have a 0 to 1 range that you need to turn into –1 to 1. This operation is known as signing. To sign a 0 to 1 value, you need to multiply the value by 2 and then subtract 1 from it, such as y = (2 x) –1;. Signing can be very useful when dealing with noise values. noise()returns values that average around 0.5. Sometimes, you need the noise values to average between –0.5 and 0.5. In such cases, all you need to do is sign the noise value.

No comments:

Post a Comment