Angles are in Radians, not Degrees. All computations are done in IEEE 754 64-bit floating point. All floating point computations are subject to small errors, known as machine ε (epsilon) errors, so avoid trying to compare them for equality. There is no way to avoid these errors when using floating point; they are built in to the technology.
If you use DECIMAL
values in trigonometric computations, they are implicitly converted to floating point, and then back to decimal.
Returns the sine of a number X expressed in radians
SELECT SIN(PI()); -> 1.2246063538224e-16
Returns the cosine of X when X is given in radians
SELECT COS(PI()); -> -1
Returns the tangent of a number X expressed in radians. Notice the result is very close to zero, but not exactly zero. This is an example of machine ε.
SELECT TAN(PI()); -> -1.2246063538224e-16
Returns the arc cosine of X if X is in the range -1 to 1
SELECT ACOS(1); -> 0
SELECT ACOS(1.01); -> NULL
Returns the arc sine of X if X is in the range -1 to 1
SELECT ASIN(0.2); -> 0.20135792079033
ATAN(x)
returns the arc tangent of a single number.
SELECT ATAN(2); -> 1.1071487177941