acos()
Computes the angle in radians whose cosine is a given number, the output radians will be in the range [0, 𝜋]. If you need the result in degrees, which is in the range [0º, 180º], you can convert it using the degrees()
function.
Syntax | acos(<num>) |
||
Arguments | Name | Type | Description |
<num> |
Numeric | The cosine value in the range of [-1,1] | |
Return Type | DOUBLE |
return acos(0.5) * 180 / pi() as degree
Result:
degree |
---|
60 |
asin()
Computes the angle in radians whose sine is a given number, the output radians will be in the range [-𝜋/2, 𝜋/2]. If you need the result in degrees, which is in the range [-90º, 90º], you can convert it using the degrees()
function.
Syntax | asin(<num>) |
||
Arguments | Name | Type | Description |
<num> |
Numeric | The sine value in the range of [-1,1] | |
Return Type | DOUBLE |
return asin(0.5) * 180 / pi() as degree
Result:
degree |
---|
30 |
atan()
Computes the angle in radians whose tangent is a given number, the output radians will be in the range [-𝜋/2, 𝜋/2]. If you need the result in degrees, which is in the range [-90º, 90º], you can convert it using the degrees()
function.
Syntax | atan(<num>) |
||
Arguments | Name | Type | Description |
<num> |
Numeric | The tangent value | |
Return Type | DOUBLE |
return atan(1) * 180 / pi() as degree
Result:
degree |
---|
45 |
cos()
Computes the cosine of an angle expressed in radian, the output will be in the range [-1, 1]. If you has an angle in degree, you can convert it to radians using the radians()
function.
Syntax | cos(<radians>) |
||
Arguments | Name | Type | Description |
<radians> |
Numeric | The angle expressed in radian | |
Return Type | DOUBLE |
return cos(60 * pi() / 180)
Result:
cos(60 * pi() / 180) |
---|
0.5 |
cot()
Computes the cotangent of an angle expressed in radian, the output will be in the range (−∞, −1] ∪ [1, +∞). If you has an angle in degree, you can convert it to radians using the radians()
function.
Syntax | cot(<radians>) |
||
Arguments | Name | Type | Description |
<radians> |
Numeric | The angle expressed in radian; cot(0) is undefined |
|
Return Type | DOUBLE |
return cot(45 * pi() / 180)
Result:
cot(45 * pi() / 180) |
---|
1 |
sin()
Computes the sine of an angle expressed in radian, the output will be in the range [-1, 1]. If you has an angle in degree, you can convert it to radians using the radians()
function.
Syntax | sin(<radians>) |
||
Arguments | Name | Type | Description |
<radians> |
Numeric | The angle expressed in radian | |
Return Type | DOUBLE |
return sin(30 * pi() / 180)
Result:
sin(30 * pi() / 180) |
---|
0.5 |
tan()
Computes the tangent of an angle expressed in radian, the output will be in the range (−∞, +∞). If you has an angle in degree, you can convert it to radians using the radians()
function.
Syntax | tan(<radians>) |
||
Arguments | Name | Type | Description |
<radians> |
Numeric | The angle expressed in radian | |
Return Type | DOUBLE |
return tan(45 * pi() / 180)
Result:
tan(45 * pi() / 180) |
---|
1 |