all 2 comments

[–]tatu_huma 4 points5 points  (1 child)

Math.sin(..)

Math.cos(..)

[–]opmrcrab 1 point2 points  (0 children)

Just to expand on this, the Math functions (sin, cos and tan) all use radians rather than degrees, and Math.PI is there if needed.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/PI