Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New hyperbolic trig functions #1191

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/ROOT/pages/appendix/gql-conformance/index.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
:description: Overview of Cypher's conformance to GQL.
= GQL conformance

*Last updated*: 27 February 2025 +
*Last updated*: 4 March 2025 +
*Neo4j version*: 2025.03

GQL is the new link:https://www.iso.org/home.html[ISO] International Standard query language for graph databases.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Cypher only supports xref:functions/mathematical-numeric.adoc#functions-ceil[`ce

| GF02
| Trigonometric functions
| xref:functions/mathematical-trigonometric.adoc#functions-acos[`acos()`], xref:functions/mathematical-trigonometric.adoc#functions-asin[`asin()`], xref:functions/mathematical-trigonometric.adoc#functions-atan[`atan()`], xref:functions/mathematical-trigonometric.adoc#functions-cos[`cos()`], xref:functions/mathematical-trigonometric.adoc#functions-cot[`cot()`], xref:functions/mathematical-trigonometric.adoc#functions-degrees[`degrees()`], xref:functions/mathematical-trigonometric.adoc#functions-radians[`radians()`], xref:functions/mathematical-trigonometric.adoc#functions-tan[`tan()`]
| xref:functions/mathematical-trigonometric.adoc#functions-acos[`acos()`], xref:functions/mathematical-trigonometric.adoc#functions-asin[`asin()`], xref:functions/mathematical-trigonometric.adoc#functions-atan[`atan()`], xref:functions/mathematical-trigonometric.adoc#functions-cos[`cos()`], xref::functions/mathematical-trigonometric.adoc#functions-cosh[`cosh()`], xref:functions/mathematical-trigonometric.adoc#functions-cot[`cot()`], xref:functions/mathematical-trigonometric.adoc#functions-degrees[`degrees()`], xref:functions/mathematical-trigonometric.adoc#functions-radians[`radians()`], xref::functions/mathematical-trigonometric.adoc#functions-sin[`sin()`], xref::functions/mathematical-trigonometric.adoc#functions-sinh[`sinh()`], xref:functions/mathematical-trigonometric.adoc#functions-tan[`tan()`], xref::functions/mathematical-trigonometric.adoc#functions-tanh[`tanh()`]
|

| GF03
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,16 @@ CREATE DATABASE db OPTIONS { seedRestoreUntil: ... }
| The option `seedRestoreUntil` can now be specified in the `CREATE DATABASE` `OPTIONS` map.
This allows a database to be seeded up to a specific date or transaction ID.
For more information, see link:{neo4j-docs-base-uri}/operations-manual/current/clustering/databases/#cluster-seed-uri[Operations Manual -> Clustering -> Seed from URI].

a|
label:functionality[]
label:new[]
[source, cypher, role="noheader"]
----
RETURN cosh(0.5), coth(0.5), sinh(0.5), tanh(0.5)
----
| Introduction of four new hyperbolic trigonometric Cypher functions.
For more information, see xref:functions/mathematical-trigonometric.adoc[Mathematical functions - trigonometric].
|===

[[cypher-deprecations-additions-removals-2025.01]]
Expand Down
20 changes: 20 additions & 0 deletions modules/ROOT/pages/functions/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,20 @@ All trigonometric functions operate on radians, unless otherwise specified.
| `cos(input :: FLOAT) :: FLOAT`
| Returns the cosine of a `FLOAT`.

1.1+| xref::functions/mathematical-trigonometric.adoc#functions-cosh[`cosh()`]
| `cosh(input :: FLOAT) :: FLOAT`
| Returns the hyperbolic cosine of a `FLOAT`.
label:new[Introduced in 2025.03]

1.1+| xref::functions/mathematical-trigonometric.adoc#functions-cot[`cot()`]
| `cot(input :: FLOAT) :: FLOAT`
| Returns the cotangent of a `FLOAT`.

1.1+| xref::functions/mathematical-trigonometric.adoc#functions-coth[`coth()`]
| `coth(input :: FLOAT) :: FLOAT`
| Returns the hyperbolic cotangent of a `FLOAT`.
label:new[Introduced in 2025.03]

1.1+| xref::functions/mathematical-trigonometric.adoc#functions-degrees[`degrees()`]
| `degrees(input :: FLOAT) :: FLOAT`
| Converts radians to degrees.
Expand All @@ -334,10 +344,20 @@ All trigonometric functions operate on radians, unless otherwise specified.
| `sin(input :: FLOAT) :: FLOAT`
| Returns the sine of a `FLOAT`.

1.1+| xref::functions/mathematical-trigonometric.adoc#functions-sinh[`sinh()`]
| `sinh(input :: FLOAT) :: FLOAT`
| Returns the hyperbolic sine of a `FLOAT`.
label:new[Introduced in 2025.03]

1.1+| xref::functions/mathematical-trigonometric.adoc#functions-tan[`tan()`]
| `tan(input :: FLOAT) :: FLOAT`
| Returns the tangent of a `FLOAT`.

1.1+| xref::functions/mathematical-trigonometric.adoc#functions-tanh[`tanh()`]
| `tanh(input :: FLOAT) :: FLOAT`
| Returns the hyperbolic tangent of a `FLOAT`.
label:new[Introduced in 2025.03]

|===


Expand Down
188 changes: 188 additions & 0 deletions modules/ROOT/pages/functions/mathematical-trigonometric.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,52 @@ The cosine of `0.5` is returned.

======

[role=label--new-2025.03]
[[functions-cosh]]
== cosh()

.Details
|===
| *Syntax* 3+| `cosh(input)`
| *Description* 3+| Returns the hyperbolic cosine of a `FLOAT`.
.2+| *Arguments* | *Name* | *Type* | *Description*
| `input` | `FLOAT` | A value.
| *Returns* 3+| `FLOAT`
|===

.Considerations
|===

| `cosh(null)` returns `null`.

|===


.+cosh()+
======

.Query
// tag::functions_mathematical_trigonometric_cos[]
[source, cypher, indent=0]
----
RETURN cosh(0.7)
----
// end::functions_mathematical_trigonometric_cos[]

The hyperbolic cosine of `0.7` is returned.

.Result
[role="queryresult",options="header,footer",cols="1*<m"]
|===

| cosh(0.7)
| 1.255169005630943
1+d|Rows: 1

|===

======


[[functions-cot]]
== cot()
Expand Down Expand Up @@ -281,6 +327,53 @@ The cotangent of `0.5` is returned.
======


[role=label--new-2025.03]
[[functions-coth]]
== coth()

.Details
|===
| *Syntax* 3+| `coth(input)`
| *Description* 3+| Returns the hyperbolic cotangent of a `FLOAT`.
.2+| *Arguments* | *Name* | *Type* | *Description*
| `input` | `FLOAT` | A value.
| *Returns* 3+| `FLOAT`
|===

.Considerations
|===

| `coth(null)` returns `null`.
| `coth(0)` returns `NaN`.

|===

.+coth()+
======

.Query
// tag::functions_mathematical_trigonometric_cot[]
[source, cypher, indent=0]
----
RETURN coth(0.7)
----
// end::functions_mathematical_trigonometric_cot[]

The hyperbolic cotangent of `0.7` is returned.

.Result
[role="queryresult",options="header,footer",cols="1*<m"]
|===

| coth(0.7)
| 1.654621635803
1+d|Rows: 1

|===

======


[[functions-degrees]]
== degrees()

Expand Down Expand Up @@ -535,6 +628,53 @@ The sine of `0.5` is returned.
======


[role=label--new-2025.03]
[[functions-sinh]]
== sinh()

.Details
|===
| *Syntax* 3+| `sinh(input)`
| *Description* 3+| Returns the hyperbolic sine of a `FLOAT`.
.2+| *Arguments* | *Name* | *Type* | *Description*
| `input` | `FLOAT` | A value.
| *Returns* 3+| `FLOAT`
|===

.Considerations
|===

| `sinh(null)` returns `null`.

|===


.+sinh()+
======

.Query
// tag::functions_mathematical_trigonometric_sin[]
[source, cypher, indent=0]
----
RETURN sinh(0.7)
----
// end::functions_mathematical_trigonometric_sin[]

The hyperbolic sine of `0.7` is returned.

.Result
[role="queryresult",options="header,footer",cols="1*<m"]
|===

| sinh(0.7)
| 0.75858370184
1+d|Rows: 1

|===

======


[[functions-tan]]
== tan()

Expand Down Expand Up @@ -580,3 +720,51 @@ The tangent of `0.5` is returned.

======



[role=label--new-2025.03]
[[functions-tanh]]
== tanh()

.Details
|===
| *Syntax* 3+| `tanh(input)`
| *Description* 3+| Returns the hyperbolic tangent of a `FLOAT`.
.2+| *Arguments* | *Name* | *Type* | *Description*
| `input` | `FLOAT` | A value.
| *Returns* 3+| `FLOAT`
|===

.Considerations
|===

| `tanh(null)` returns `null`.

|===


.+tanh()+
======

.Query
// tag::functions_mathematical_trigonometric_tan[]
[source, cypher, indent=0]
----
RETURN tanh(0.7)
----
// end::functions_mathematical_trigonometric_tan[]

The hyperbolic tangent of `0.7` is returned.

.Result
[role="queryresult",options="header,footer",cols="1*<m"]
|===

| tanh(0.7)
| 0.604367777117
1+d|Rows: 1

|===

======