How can I calculate y
in this curve ? t
is the variable. Origin is (0|0)
of course.
t=0
, t=0,5
and t=1
must be perfectly horizontal (incline = 0)I have to calculate this a few hundred times each frame in Actionscript 3. So calculation needs good performance. Right now I'm actually failing at correctness of calculation (I'm not a mathematician).
Not sure about performance, but
-0.5 * cos(x * 2pi) + 0.5
AS3:
y = -0.5 * Math.cos(x * 2 * Math.PI) + 0.5;
seems to be the curve you are looking for.
You can view or edit the curve here: wolfram alfa curve