@@ -790,6 +790,68 @@ public Cosh cosh(AngularUnit unit) {
790790 public Tan tan () {
791791 return tan (AngularUnit .RADIANS );
792792 }
793+
794+ /**
795+ * Creates new {@link AggregationExpression} that calculates the inverse tangent of a numeric value.
796+ *
797+ * @return new instance of {@link ATan}.
798+ */
799+ public ATan atan () {
800+ return usesFieldRef () ? ATan .atanOf (fieldReference ) : ATan .atanOf (expression );
801+ }
802+
803+ /**
804+ * Creates new {@link AggregationExpression} that calculates the inverse tangent of the the numeric value
805+ * divided by the given numeric value in the argument.
806+ *
807+ * @param the numeric value
808+ * @return new instance of {@link ATan2}.
809+ */
810+ public ATan2 atan2 (Number value ) {
811+
812+ Assert .notNull (value , "Value must not be null!" );
813+ return createATan2 ().atan2of (value );
814+ }
815+
816+ /**
817+ * Creates new {@link AggregationExpression} that calculates the inverse tangent of the the numeric value
818+ * divided by the given field reference in the argument.
819+ *
820+ * @param the numeric value
821+ * @return new instance of {@link ATan2}.
822+ */
823+ public ATan2 atan2 (String fieldReference ) {
824+
825+ Assert .notNull (fieldReference , "FieldReference must not be null!" );
826+ return createATan2 ().atan2of (fieldReference );
827+ }
828+
829+ /**
830+ * Creates new {@link AggregationExpression} that calculates the inverse tangent of the the numeric value
831+ * divided by the given {@link AggregationExpression} in the argument.
832+ *
833+ * @param the numeric value
834+ * @return new instance of {@link ATan2}.
835+ */
836+ public ATan2 atan2 (AggregationExpression expression ) {
837+
838+ Assert .notNull (expression , "Expression must not be null!" );
839+ return createATan2 ().atan2of (expression );
840+ }
841+
842+ private ATan2 createATan2 () {
843+
844+ return usesFieldRef () ? ATan2 .valueOf (fieldReference ) : ATan2 .valueOf (expression );
845+ }
846+
847+ /**
848+ * Creates new {@link AggregationExpression} that calculates the inverse hyperbolic tangent of a numeric value.
849+ *
850+ * @return new instance of {@link ATanh}.
851+ */
852+ public ATanh atanh () {
853+ return usesFieldRef () ? ATanh .atanhOf (fieldReference ) : ATanh .atanhOf (expression );
854+ }
793855
794856 /**
795857 * Creates new {@link AggregationExpression} that calculates the tangent of a numeric value in the given
@@ -2579,6 +2641,148 @@ protected String getMongoMethod() {
25792641 return "$tan" ;
25802642 }
25812643 }
2644+
2645+
2646+ /**
2647+ * An {@link AggregationExpression expression} that calculates the inverse tangent of a value.
2648+ *
2649+ */
2650+ public static class ATan extends AbstractAggregationExpression {
2651+
2652+ private ATan (Object value ) {
2653+ super (value );
2654+ }
2655+
2656+ /**
2657+ * Creates a new {@link AggregationExpression} that calculates the inverse tangent of a value.
2658+ *
2659+ * @param fieldReference the name of the {@link Field field} that resolves to a numeric value.
2660+ * @return new instance of {@link ATan}.
2661+ */
2662+ public static ATan atanOf (String fieldReference ) {
2663+
2664+ Assert .notNull (fieldReference , "FieldReference must not be null!" );
2665+ return new ATan (Fields .field (fieldReference ));
2666+ }
2667+
2668+ /**
2669+ * Creates a new {@link AggregationExpression} that calculates the inverse tangent of a value.
2670+ * <p />
2671+ *
2672+ * @param expression the {@link AggregationExpression expression} that resolves to a numeric value.
2673+ * @return new instance of {@link ATan}.
2674+ */
2675+ public static ATan atanOf (AggregationExpression expression ) {
2676+ return new ATan (expression );
2677+ }
2678+
2679+ /**
2680+ * Creates a new {@link AggregationExpression} that calculates the inverse tangent of a value.
2681+ *
2682+ * @param value anything ({@link Field field}, {@link AggregationExpression expression}, ...) that resolves to a
2683+ * numeric value.
2684+ * @return new instance of {@link ATan}.
2685+ */
2686+ public static ATan atanof (Number value ) {
2687+ return new ATan (value );
2688+ }
2689+
2690+ @ Override
2691+ protected String getMongoMethod () {
2692+ return "$atan" ;
2693+ }
2694+ }
2695+
2696+ /**
2697+ * An {@link AggregationExpression expression} that calculates the inverse
2698+ * tangent of y / x, where y and x are the first and second values passed to the
2699+ * expression respectively.
2700+ *
2701+ */
2702+ public static class ATan2 extends AbstractAggregationExpression {
2703+
2704+ private ATan2 (List <?> value ) {
2705+ super (value );
2706+ }
2707+
2708+ /**
2709+ * Creates a new {@link AggregationExpression} that calculates the inverse
2710+ * tangent of of y / x, where y and x are the first and second values passed to
2711+ * the expression respectively.
2712+ *
2713+ * @param fieldReference the name of the {@link Field field} that resolves to a
2714+ * numeric value.
2715+ * @return new instance of {@link ATan2}.
2716+ */
2717+ public static ATan2 valueOf (String fieldReference ) {
2718+
2719+ Assert .notNull (fieldReference , "FieldReference must not be null!" );
2720+ return new ATan2 (asFields (fieldReference ));
2721+ }
2722+
2723+ /**
2724+ * Creates a new {@link AggregationExpression} that calculates the inverse
2725+ * tangent of of y / x, where y and x are the first and second values passed to
2726+ * the expression respectively.
2727+ *
2728+ * @param expression the {@link AggregationExpression expression} that resolves
2729+ * to a numeric value.
2730+ * @return new instance of {@link ATan2}.
2731+ */
2732+ public static ATan2 valueOf (AggregationExpression expression ) {
2733+
2734+ Assert .notNull (expression , "Expression must not be null!" );
2735+ return new ATan2 ((Collections .singletonList (expression )));
2736+ }
2737+
2738+
2739+ /**
2740+ * Creates a new {@link AggregationExpression} that calculates the inverse
2741+ * tangent of of y / x, where y and x are the first and second values passed to
2742+ * the expression respectively.
2743+ *
2744+ * @param value anything ({@link Field field}, {@link AggregationExpression
2745+ * expression}, ...) that resolves to a numeric value.
2746+ * @return new instance of {@link ATan2}.
2747+ */
2748+ public ATan2 atan2of (String fieldReference ) {
2749+
2750+ Assert .notNull (fieldReference , "FieldReference must not be null!" );
2751+ return new ATan2 (append (Fields .field (fieldReference )));
2752+ }
2753+
2754+ /**
2755+ * Creates a new {@link AggregationExpression} that calculates the hyperbolic tangent of a value that is measured in
2756+ * {@link AngularUnit#RADIANS}.
2757+ *
2758+ * @param value anything ({@link Field field}, {@link AggregationExpression expression}, ...) that resolves to a
2759+ * numeric value.
2760+ * @return new instance of {@link ATan2}.
2761+ */
2762+ public ATan2 atan2of (AggregationExpression expression ) {
2763+
2764+ Assert .notNull (expression , "Expression must not be null!" );
2765+ return new ATan2 (append (expression ));
2766+ }
2767+
2768+ /**
2769+ * Creates a new {@link AggregationExpression} that calculates the inverse
2770+ * tangent of of y / x, where y and x are the first and second values passed to
2771+ * the expression respectively.
2772+ *
2773+ * @param value of type {@link Number}
2774+ * @return new instance of {@link ATan2}.
2775+ */
2776+ public ATan2 atan2of (Number value ) {
2777+
2778+ return new ATan2 (append (value ));
2779+ }
2780+
2781+ @ Override
2782+ protected String getMongoMethod () {
2783+ return "$atan2" ;
2784+ }
2785+ }
25822786
25832787 /**
25842788 * An {@link AggregationExpression expression} that calculates the hyperbolic tangent of a value that is measured in
@@ -2684,6 +2888,60 @@ protected String getMongoMethod() {
26842888 return "$tanh" ;
26852889 }
26862890 }
2891+
2892+ /**
2893+ * An {@link AggregationExpression expression} that calculates the inverse
2894+ * hyperbolic tangent of a value
2895+ *
2896+ */
2897+ public static class ATanh extends AbstractAggregationExpression {
2898+
2899+ private ATanh (Object value ) {
2900+ super (value );
2901+ }
2902+
2903+ /**
2904+ * Creates a new {@link AggregationExpression} that calculates the inverse
2905+ * hyperbolic tangent of a value.
2906+ *
2907+ * @param fieldReference the name of the {@link Field field} that resolves to a
2908+ * numeric value.
2909+ * @return new instance of {@link ATanh}.
2910+ */
2911+ public static ATanh atanhOf (String fieldReference ) {
2912+ return new ATanh (Fields .field (fieldReference ));
2913+ }
2914+
2915+ /**
2916+ * Creates a new {@link AggregationExpression} that calculates the inverse
2917+ * hyperbolic tangent of a value.
2918+ * <p />
2919+ *
2920+ * @param expression the {@link AggregationExpression expression} that resolves
2921+ * to a numeric value.
2922+ * @return new instance of {@link ATanh}.
2923+ */
2924+ public static ATanh atanhOf (AggregationExpression expression ) {
2925+ return new ATanh (expression );
2926+ }
2927+
2928+ /**
2929+ * Creates a new {@link AggregationExpression} that calculates the inverse
2930+ * hyperbolic tangent of a value.
2931+ *
2932+ * @param value anything ({@link Field field}, {@link AggregationExpression
2933+ * expression}, ...) that resolves to a numeric value.
2934+ * @return new instance of {@link ATanh}.
2935+ */
2936+ public static ATanh atanhof (Object value ) {
2937+ return new ATanh (value );
2938+ }
2939+
2940+ @ Override
2941+ protected String getMongoMethod () {
2942+ return "$atanh" ;
2943+ }
2944+ }
26872945
26882946 /**
26892947 * {@link Rand} returns a floating value between 0 and 1.
0 commit comments