UltipaDocs
Try Playground
  • Introduction
  • Terminologies
    • Graphset
    • Schema
    • Property
    • Constraints
    • Insert
    • Overwrite or Insert
    • Upsert
    • Update
    • Delete
    • Find Nodes
    • Find Edges
      • AB
      • Autonet
      • Spread
      • Path Template
      • K-Hop
      • K-Hop Template
    • GROUP BY
    • ORDER BY
    • SKIP
    • LIMIT
    • WHERE
    • RETURN
    • WITH
    • UNCOLLECT
    • UNION
    • UNION ALL
    • CALL
    • All Functions
    • Path Functions
    • Aggregate Functions
    • Mathematical Functions
    • Trigonometric Functions
    • String Functions
    • List Functions
    • Datetime Functions
    • Spatial Functions
    • Table Functions
    • Null Functions
    • Type Conversion Functions
  • Operators
  • Expressions
    • Index
    • Full-text Index
    • Vector Index
    • Cache
    • Overview
    • Managing HDC Graphs
    • HDC Graph Queries
    • Process
    • Job
    • Execution Plan
    • Alias
    • Filter
    • Values and Types
    • Data Flow in Queries
    • Comments
    • Reserved Words
  • Access Control
  1. Docs
  2. /
  3. UQL
  4. /
  5. Functions

Trigonometric Functions

acos()

Computes the angle in radians whose cosine is a given number. The resulting radians will be in the range [0, πœ‹]. If the result is needed in degrees (range [0ΒΊ, 180ΒΊ]), you can convert it using the degrees() function.

Syntaxacos(<num>)
ArgumentsNameTypeDescription
<num>NumericThe cosine value in the range of [-1,1]
Return TypeDOUBLE
UQL
return acos(0.5) * 180 / pi() as degree

Result:

degree
60

asin()

Computes the angle in radians whose sine is a given number. The resulting radians will be in the range [-πœ‹/2, πœ‹/2]. If the result is needed in degrees (range [-90ΒΊ, 90ΒΊ]), you can convert it using the degrees() function.

Syntaxasin(<num>)
ArgumentsNameTypeDescription
<num>NumericThe sine value in the range of [-1,1]
Return TypeDOUBLE
UQL
return asin(0.5) * 180 / pi() as degree

Result:

degree
30

atan()

Computes the angle in radians whose tangent is a given number. The resulting radians will be in the range [-πœ‹/2, πœ‹/2]. If the result is needed in degrees (range [-90ΒΊ, 90ΒΊ]), you can convert it using the degrees() function.

Syntaxatan(<num>)
ArgumentsNameTypeDescription
<num>NumericThe tangent value
Return TypeDOUBLE
UQL
return atan(1) * 180 / pi() as degree

Result:

degree
45

cos()

Computes the cosine of an angle expressed in radians. The output will be in the range [-1, 1]. If the angle is in degrees, you can convert it to radians using the radians() function.

Syntaxcos(<radians>)
ArgumentsNameTypeDescription
<radians>NumericThe angle expressed in radian
Return TypeDOUBLE
UQL
return cos(60 * pi() / 180)

Result:

cos(60 * pi() / 180)
0.5

cot()

Computes the cotangent of an angle expressed in radians. The output will be in the range (βˆ’βˆž, βˆ’1] βˆͺ [1, +∞). If the angle is in degrees, you can convert it to radians using the radians() function.

Syntaxcot(<radians>)
ArgumentsNameTypeDescription
<radians>NumericThe angle expressed in radian; cot(0) is undefined
Return TypeDOUBLE
UQL
return cot(45 * pi() / 180)

Result:

cot(45 * pi() / 180)
1

sin()

Computes the sine of an angle expressed in radians. The output will be in the range [-1, 1]. If the angle is in degrees, you can convert it to radians using the radians() function.

Syntaxsin(<radians>)
ArgumentsNameTypeDescription
<radians>NumericThe angle expressed in radian
Return TypeDOUBLE
UQL
return sin(30 * pi() / 180)

Result:

sin(30 * pi() / 180)
0.5

tan()

Computes the tangent of an angle expressed in radians. The output will be in the range (βˆ’βˆž, +∞). If the angle is in degrees, you can convert it to radians using the radians() function.

Syntaxtan(<radians>)
ArgumentsNameTypeDescription
<radians>NumericThe angle expressed in radian
Return TypeDOUBLE
UQL
return tan(45 * pi() / 180)

Result:

tan(45 * pi() / 180)
1