The blog represents the part 2 of the trigonometric functions in age. You can also refer to the part 1 here.
asin:
asin() returns the arcsine of the number.
Syntax:
asin(a numeric expression)
Returns:
The function returns a floating point number.
Query:
SELECT *
FROM cypher('graph_name', $$
RETURN asin(0.5)
$$) as (s agtype);
Above query will return arcsine of 0.5.
acos:
acos() returns the arccosine of the number.
Syntax:
acos(a numeric expression)
Returns:
The function returns a floating point number.
Query:
SELECT *
FROM cypher('graph_name', $$
RETURN acos(0.5)
$$) as (arc_c agtype);
Above query will return arccosine of 0.5.
atan:
atan() returns the arctangent of the number.
Syntax:
atan(a numeric expression)
Returns:
The function returns a floating point number.
Query:
SELECT *
FROM cypher('graph_name', $$
RETURN atan(0.5)
$$) as (arc_t agtype);
Above query will return the arctangent of 0.5.
atan2():
atan2() returns the arctangent2 of a set of coordinates in radians.
Syntax:
atan2(a numeric expression 1, a numeric expression 2)
Returns:
The function returns a floating point number.
Query:
SELECT *
FROM cypher('graph_name', $$
RETURN atan2(0.5, 0.6)
$$) as (arc_t2 agtype);
Above query will return arctangent2 of 0.5 and 0.6.
References:
You can view more on GitHub and documentation of Apache age by following these links:
Top comments (0)