Roger Travis
Roger Travis

Reputation: 8548

Please help offsetting a coordinate in a non-linear way

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. enter image description here

How would you do that? Thanks!

Upvotes: 0

Views: 51

Answers (1)

Sarwar Erfan
Sarwar Erfan

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

Related Questions