Skip to content

Commit ee72c1e

Browse files
committed
DOCS-12338: 4.2 Trigonometry Expressions (Aggregation)
1 parent 9d7968d commit ee72c1e

18 files changed

+2259
-1
lines changed

source/includes/extracts-agg-operators.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,58 @@
1+
ref: agg-operators-trigonometry
2+
content: |
3+
4+
.. include:: /includes/intro-aggregation-trigonometry.rst
5+
6+
.. list-table::
7+
:header-rows: 1
8+
:widths: 20 80
9+
10+
* - Name
11+
- Description
12+
13+
* - :expression:`$sin`
14+
- Returns the sine of a value that is measured in radians.
15+
16+
* - :expression:`$cos`
17+
- Returns the cosine of a value that is measured in radians.
18+
19+
* - :expression:`$tan`
20+
- Returns the tangent of a value that is measured in radians.
21+
22+
* - :expression:`$asin`
23+
- Returns the inverse sin (arc sine) of a value in radians.
24+
25+
* - :expression:`$acos`
26+
- Returns the inverse cosine (arc cosine) of a value in radians.
27+
28+
* - :expression:`$atan`
29+
- Returns the inverse tangent (arc tangent) of a value in
30+
radians.
31+
32+
* - :expression:`$atan2`
33+
- Returns the inverse tangent (arc tangent) of ``y / x`` in
34+
radians, where ``y`` and ``x`` are the first and second
35+
values passed to the expression respectively.
36+
37+
* - :expression:`$asinh`
38+
- Returns the inverse hyperbolic sine (hyperbolic arc sine) of a
39+
value in radians.
40+
41+
* - :expression:`$acosh`
42+
- Returns the inverse hyperbolic cosine (hyperbolic arc cosine)
43+
of a value in radians.
44+
45+
* - :expression:`$atanh`
46+
- Returns the inverse hyperbolic tangent (hyperbolic arc
47+
tangent) of a value in radians.
48+
49+
* - :expression:`$degreesToRadians`
50+
- Converts a value from degrees to radians.
51+
52+
* - :expression:`$radiansToDegrees`
53+
- Converts a value from radians to degrees.
54+
55+
---
156
ref: agg-operators-arithmetic
257
content: |
358
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Trigonometry expressions perform trigonometric operations on numbers.
2+
Values that represent angles are always input or output in radians. Use
3+
:expression:`$degreesToRadians` and :expression:`$radiansToDegrees` to
4+
convert between degree and radian measurements.

source/includes/ref-toc-aggregation-operators.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ name: :expression:`$abs`
22
description: Returns the absolute value of a number.
33
file: /reference/operator/aggregation/abs
44
---
5+
name: :expression:`$acos`
6+
file: /reference/operator/aggregation/acos
7+
description: |
8+
Returns the inverse cosine (arc cosine) of a value in radians.
9+
---
10+
name: :expression:`$acosh`
11+
file: /reference/operator/aggregation/acosh
12+
description: |
13+
Returns the inverse hyperbolic cosine (hyperbolic arc cosine) of a value in radians.
14+
---
515
name: :expression:`$add`
616
file: /reference/operator/aggregation/add
717
description: |
@@ -46,6 +56,33 @@ file: /reference/operator/aggregation/arrayToObject
4656
description: |
4757
Converts an array of key value pairs to a document.
4858
---
59+
name: :expression:`$asin`
60+
file: /reference/operator/aggregation/asin
61+
description: |
62+
Returns the inverse sine (arc sine) of a value in radians.
63+
---
64+
name: :expression:`$asinh`
65+
file: /reference/operator/aggregation/asinh
66+
description: |
67+
Returns the inverse hyperbolic sin (hyperbolic arc sine) of a value in radians.
68+
---
69+
name: :expression:`$atan`
70+
file: /reference/operator/aggregation/atan
71+
description: |
72+
Returns the inverse tangent (arc tangent) of a value in radians.
73+
---
74+
name: :expression:`$atan2`
75+
file: /reference/operator/aggregation/atan2
76+
description: |
77+
Returns the inverse tangent (arc tangent) of ``y / x`` in radians,
78+
where ``y`` and ``x`` are the first and second values passed to the
79+
expression respectively.
80+
---
81+
name: :expression:`$atanh`
82+
file: /reference/operator/aggregation/atanh
83+
description: |
84+
Returns the inverse hyperbolic tangent (hyperbolic arc tangent) of a value in radians.
85+
---
4986
name: :group:`$avg`
5087
file: /reference/operator/aggregation/avg
5188
description: |
@@ -91,6 +128,11 @@ file: /reference/operator/aggregation/convert
91128
description: |
92129
Converts a value to a specified type.
93130
---
131+
name: :expression:`$cos`
132+
file: /reference/operator/aggregation/cos
133+
description: |
134+
Returns the cosine of a value that is measured in radians.
135+
---
94136
name: :expression:`$dateFromParts`
95137
file: /reference/operator/aggregation/dateFromParts
96138
description: |
@@ -129,6 +171,11 @@ description: |
129171
Returns the day of the year for a date as a number between 1 and 366
130172
(leap year).
131173
---
174+
name: :expression:`$degreesToRadians`
175+
file: /reference/operator/aggregation/degreesToRadians
176+
description: |
177+
Converts a value from degrees to radians.
178+
---
132179
name: :expression:`$divide`
133180
file: /reference/operator/aggregation/divide
134181
description: |
@@ -392,6 +439,11 @@ description: |
392439
393440
Available in :pipeline:`$group` stage only.
394441
---
442+
name: :expression:`$radiansToDegrees`
443+
file: /reference/operator/aggregation/radiansToDegrees
444+
description: |
445+
Converts a value from radians to degrees.
446+
---
395447
name: :expression:`$range`
396448
description: |
397449
Outputs an array containing a sequence of integers according to
@@ -460,6 +512,11 @@ description: |
460512
Returns the number of elements in the array. Accepts a single
461513
expression as argument.
462514
---
515+
name: :expression:`$sin`
516+
file: /reference/operator/aggregation/sin
517+
description: |
518+
Returns the sine of a value that is measured in radians.
519+
---
463520
name: :expression:`$slice`
464521
description: |
465522
Returns a subset of an array.
@@ -561,6 +618,11 @@ description: |
561618
expression and breaks out of the control flow.
562619
563620
---
621+
name: :expression:`$tan`
622+
file: /reference/operator/aggregation/tan
623+
description: |
624+
Returns the tangent of a value that is measured in radians.
625+
---
564626
name: :expression:`$toBool`
565627
file: /reference/operator/aggregation/toBool
566628
description: |

source/meta/aggregation-quick-reference.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,13 @@ Text Expression Operator
185185

186186
.. include:: /includes/extracts/agg-operators-text.rst
187187

188+
.. _agg-quick-ref-operator-trigonometry:
189+
190+
Trigonometry Expression Operators
191+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192+
193+
.. include:: /includes/extracts/agg-operators-trigonometry.rst
194+
188195
Type Expression Operators
189196
~~~~~~~~~~~~~~~~~~~~~~~~~
190197

source/reference/operator/aggregation.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ stages </reference/operator/aggregation-pipeline>`.
3434

3535
.. include:: /includes/intro-aggregation-operator-expressions.rst
3636

37-
3837
Arithmetic Expression Operators
3938
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4039

@@ -92,6 +91,11 @@ Text Expression Operator
9291

9392
.. include:: /includes/extracts/agg-operators-text.rst
9493

94+
Trigonometry Expression Operators
95+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96+
97+
.. include:: /includes/extracts/agg-operators-trigonometry.rst
98+
9599
Type Expression Operators
96100
~~~~~~~~~~~~~~~~~~~~~~~~~
97101

0 commit comments

Comments
 (0)