The following line:
console.log(ship.x + " + " + (4/3) + " * " + ship.r + " * " + Math.cos(ship.a));
returns:
50 + 1.3333333333333333 * 15 * 6.123233995736766e-17
however when I actually do the math with JavaScript via:
console.log(ship.x + 4 / 3 * ship.r * Math.cos(ship.a));
it returns the integer value of '50'? How is this possible? The first value in the line is 50 so you would think it would logically be a bigger number once it is ran. I've tried PEMDAS and many other variations and never end up with the value of 50. What exactly is JavaScript doing with the above code? Here's a link to the entire code page: https://codepen.io/hoyos/pen/vYJqaRw?editors=0010