### Bouncing Ball expression problem

Posted:

**June 11th, 2019, 8:32 pm**I created a bouncing ball animation, the expression effect like this:

The wrong codeļ¼

I guess the problem is related to the X-axis sin function, but I don't know how to solve it, if anybody know the problem please let me know, thank you guys very much!

The wrong codeļ¼

Code: Select all

```
yf = 2.5;
yd = 3;
yamp = 600;
cos = Math.cos(yf*time*2*Math.PI)/Math.exp(yd*time);
elevcos = Math.abs(cos);
y = yamp * elevcos;
xf = 2.5;
xd = 1;
xamp = -400;
sin = Math.sin(yf*time*2*Math.PI)/Math.exp(yd*time);
elevsin = Math.abs(sin);
x = xamp * elevsin;
[value[0]-x,value[1]-y]
```

I guess the problem is related to the X-axis sin function, but I don't know how to solve it, if anybody know the problem please let me know, thank you guys very much!