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 | ||
GQLRETURN degrees(acos(0.5)) AS degree
Result: 60
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 | ||
GQLRETURN degrees(asin(0.5)) AS degree
Result: 30
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 | ||
GQLRETURN degrees(atan(1)) AS degree
Result: 45
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 | ||
GQLRETURN cos(radians(60))
Result: 0.5
Computes the hyperbolic cosine of an angle expressed in radian, the output will be in the range [1, +∞). If you has an angle in degree, you can convert it to radians using the radians() function.
| Syntax | cosh(<radians>) | ||
| Arguments | Name | Type | Description |
<radians> | Numeric | The angle expressed in radian | |
| Return Type | DOUBLE | ||
GQLRETURN cosh(radians(60))
Result: 1.60028685770239
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 | ||
GQLRETURN cot(radians(45))
Result: 1
Converts an angle from radians to degrees:
| Syntax | degrees(<radians>) | ||
| Arguments | Name | Type | Description |
<radians> | Numeric | The angle expressed in radian | |
| Return Type | DOUBLE | ||
GQLRETURN degrees(pi())
Result: 180
Converts an angle from degrees to radians:
| Syntax | radians(<degrees>) | ||
| Arguments | Name | Type | Description |
<degrees> | Numeric | The angle expressed in degree | |
| Return Type | DOUBLE | ||
GQLRETURN radians(60)
Result: 1.0471975511965976
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 | ||
GQLRETURN sin(radians(30))
Result: 0.5
Computes the hyperbolic sine 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 | sinh(<radians>) | ||
| Arguments | Name | Type | Description |
<radians> | Numeric | The angle expressed in radian | |
| Return Type | DOUBLE | ||
GQLRETURN sinh(radians(30))
Result: 0.54785347388804
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 | ||
GQLRETURN tan(radians(45))
Result: 1
Computes the hyperbolic tangent 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 | tanh(<radians>) | ||
| Arguments | Name | Type | Description |
<radians> | Numeric | The angle expressed in radian | |
| Return Type | DOUBLE | ||
GQLRETURN tanh(radians(45))
Result: 0.655794202632672