Q:

Math function returns wrong value

I have the following calculations:
let sinX = sin(150.0) //returns -0,71487
let cosY = cos(150.0) // returns 0,699250

But the real values for sinX = 0,5 and for cosY = -0,86.
Does anybody know where is the error?

A:

The calculation is correct. However sin and cos take their param in radians, not degrees.

In calculus and most other branches of mathematics beyond practical
  geometry, angles are universally measured in radians.  One radian is
  equal to 180/π degrees.
To convert from radians to degrees, multiply by 180/π.

https://en.wikipedia.org/wiki/Radian

