Reputation: 8548
Suppose you have a coordinate that can be anywhere from 0.0 to 1.0 ( see blue line ), but I need to offset it as the red line.
I.e. when it is 0.75 it should be 0.75 + offsetValue, when it is 0.25 it should be 0.25 - offsetValue.
How would you do that? Thanks!
Upvotes: 0
Views: 51
Reputation: 18068
use something like -sin(blue_value * 2 * PI)
or sin(-1 * blue_value * 2 * PI)
What you want is a negative sine curve from 0-2PI.
Check this
Upvotes: 2