I'm learning to do some simple animations with JavaScript and canvas and trying to do some simple physics animations, where I do calculations and animate, displacement of the objects.
However, I encountered quite an odd problem when I put :
this.ax = (this.vx)^2;
Everything works just fine, but when I do :
this.ax = (this.vx)^2 + (this.vy)^2;
nothing moves. There is work around to just put :
this.ax = (this.vx)^2 + this.vy * this.vy;
But I wonder why simply squaring or adding Math.pow doesn't do the trick here?
Edit: to try and keep code clean and consistent, I tried using this.vx * this.vx and animations were messed up again.