From c543036a0f73aba0450a9881f11472a524473bde Mon Sep 17 00:00:00 2001 From: Telumire <31185220+Telumire@users.noreply.github.com> Date: Mon, 25 Oct 2021 22:13:18 +0200 Subject: [PATCH] Add missing parameter to atan2 operator (#6142) * Added missing trigonometrics filter operators This PR adds support to trigonometry operators, allowing to create spider graphs and other geometric shapes with filters. * Adds the missing trigonometric filter operators This PR adds support to the missing trigonometric filter operators (cos, sin, tan, acos, asin, atan, atan2), allowing to create spider graphs, [pie charts, donut charts, polar charts](https://ffoodd.github.io/chaarts/pie-charts.html) and other geometric shapes with filters, which was previously not possible without add-ons. Example : `[[2]cos[]] = -0.4161468365471424` See also this radar chart made in wikitext by @saqimtiaz using the new trigonometric operators : https://saqimtiaz.github.io/sq-tw/temp/radar-chart-demo.html * Add documentation for the Trigonometric Operators Accompanies code changes #6127 * Fix formatting of atan2 Operator.tid Removed two empty lines at the end of the tiddler * Add examples for the trigonometric operators Accompanies code changes Jermolene#6127 * Fix version in the doc for trigonometric operators This PR fix the content of the documentation tiddlers regarding trigonometric operators (#6131). <<.from-version "5.1.20">> was changed to <<.from-version "5.1.21">> * Fix formatting of atan2 Operator.tid Removed two empty lines at the end of the tiddler * Add missing parameter to atan2 operator The atan2 operator needs two parameters (Binary Mathematics Operators), this PR adds the second one that was missing. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2 for more technical info on the atan2 function. --- core/modules/filters/math.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/filters/math.js b/core/modules/filters/math.js index 434f20dd9..ed8e5eed6 100644 --- a/core/modules/filters/math.js +++ b/core/modules/filters/math.js @@ -191,7 +191,7 @@ exports.atan = makeNumericBinaryOperator( ); exports.atan2 = makeNumericBinaryOperator( - function(a) {return Math.atan2(a)} + function(a,b) {return Math.atan2(a,b)} ); //Calculate the variance of a population of numbers in an array given its mean