Basically, this is what I'm trying to acheive in its simplest form.


Does anyone know how to change sin/cos in this way? I just require them to linearly increase/decrease over the set amount of time set on the x axis.

In case of the link not working, these are the kinds of values I require:
x=0, y=0;
x=0.1, y=0.1;
x=0.9, y=0.9;
x=1.1 y=0.9;
x=1.9 y=0.1;
x=2.1 y=-0.1;
x=2.9 y=-0.9;
x=3.1 y=-0.9;
x=3.9 y=-0.1;
x=4.0 y=0;

Thanks in advance.

8 Years
Discussion Span
Last Post by Salem

So when y == 1, reverse the sign
When y == -1, reverse it again.

Well, it's possible to add a couple of if statements to make the thing work but when working with 3 axis of movement, all of which effect each other, I'd end up with 27 if statements instead of 3 formulas; I'm not one for taking the easy route, especially as in this case, there is a huge performance drop-off in doing so.

I was just wondering as the lines of my graph loosely follow the patterns of sine/cosine, whether there is a mathematical function to multiply the resulting sine/cosine values, in order to make them follow a linear path between the cap values at 1 and -1. There must be something to do this...


Yeah there's something alright.
But you're not going to like it.

> especially as in this case, there is a huge performance drop-off in doing so.
An if statement is as basic as it gets.

I count 6 (two for each axis)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.