Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: sdk/lib/math/math.dart

Issue 2852053002: Update documentation on trignometric functions. (Closed)
Patch Set: Update fingerprints. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/math_patch.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/math/math.dart
diff --git a/sdk/lib/math/math.dart b/sdk/lib/math/math.dart
index af797f0af97837f56c7bdd2af891219755f0fe54..29fcef18495e404999e3de59bfaa5a20047e1343 100644
--- a/sdk/lib/math/math.dart
+++ b/sdk/lib/math/math.dart
@@ -4,9 +4,9 @@
/**
* Mathematical constants and functions, plus a random number generator.
- *
+ *
* To use this library in your code:
- *
+ *
* import 'dart:math';
*/
library dart.math;
@@ -25,11 +25,19 @@ const double E = 2.718281828459045;
/**
* Natural logarithm of 10.
+ *
+ * The natural logarithm of 10 is the number such that `pow(E, LN10) == 10`.
+ * This value is not exact, but it is the closest representable double to the
+ * exact mathematical value.
*/
const double LN10 = 2.302585092994046;
/**
* Natural logarithm of 2.
+ *
+ * The natural logarithm of 2 is the number such that `pow(E, LN2) == 2`.
+ * This value is not exact, but it is the closest representable double to the
+ * exact mathematical value.
*/
const double LN2 = 0.6931471805599453;
@@ -134,10 +142,11 @@ T max<T extends num>(T a, T b) {
/**
* A variant of [atan].
*
- * Converts both arguments to doubles.
+ * Converts both arguments to [double]s.
*
- * Returns the angle between the positive x-axis and the vector ([b],[a]).
- * The result, in radians, is in the range -PI..PI.
+ * Returns the angle in radians between the positive x-axis
+ * and the vector ([b],[a]).
+ * The result is in the range -PI..PI.
*
* If [b] is positive, this is the same as `atan(b/a)`.
*
@@ -192,30 +201,30 @@ external double atan2(num a, num b);
external num pow(num x, num exponent);
/**
- * Converts [x] to a double and returns the sine of the value.
+ * Converts [radians] to a [double] and returns the sine of the value.
*
- * If [x] is not a finite number, the result is NaN.
+ * If [radians] is not a finite number, the result is NaN.
*/
-external double sin(num x);
+external double sin(num radians);
/**
- * Converts [x] to a double and returns the cosine of the value.
+ * Converts [radians] to a [double] and returns the cosine of the value.
*
- * If [x] is not a finite number, the result is NaN.
+ * If [radians] is not a finite number, the result is NaN.
*/
-external double cos(num x);
+external double cos(num radians);
/**
- * Converts [x] to a double and returns the tangent of the value.
+ * Converts [radians] to a [double] and returns the tangent of the value.
*
- * The tangent function is equivalent to `sin(x)/cos(x)` and may be
- * infinite (positive or negative) when `cos(x)` is equal to zero.
- * If [x] is not a finite number, the result is NaN.
+ * The tangent function is equivalent to `sin(radians)/cos(radians)` and may be
+ * infinite (positive or negative) when `cos(radians)` is equal to zero.
+ * If [radians] is not a finite number, the result is NaN.
*/
-external double tan(num x);
+external double tan(num radians);
/**
- * Converts [x] to a double and returns the arc cosine of the value.
+ * Converts [x] to a [double] and returns its arc cosine in radians.
*
* Returns a value in the range 0..PI, or NaN if [x] is outside
* the range -1..1.
@@ -223,7 +232,7 @@ external double tan(num x);
external double acos(num x);
/**
- * Converts [x] to a double and returns the arc sine of the value.
+ * Converts [x] to a [double] and returns its arc sine in radians.
*
* Returns a value in the range -PI/2..PI/2, or NaN if [x] is outside
* the range -1..1.
@@ -231,21 +240,21 @@ external double acos(num x);
external double asin(num x);
/**
- * Converts [x] to a double and returns the arc tangent of the value.
+ * Converts [x] to a [double] and returns its arc tangent in radians.
*
* Returns a value in the range -PI/2..PI/2, or NaN if [x] is NaN.
*/
external double atan(num x);
/**
- * Converts [x] to a double and returns the positive square root of the value.
+ * Converts [x] to a [double] and returns the positive square root of the value.
*
* Returns -0.0 if [x] is -0.0, and NaN if [x] is otherwise negative or NaN.
*/
external double sqrt(num x);
/**
- * Converts [x] to a double and returns the natural exponent, [E],
+ * Converts [x] to a [double] and returns the natural exponent, [E],
* to the power [x].
*
* Returns NaN if [x] is NaN.
@@ -253,7 +262,7 @@ external double sqrt(num x);
external double exp(num x);
/**
- * Converts [x] to a double and returns the natural logarithm of the value.
+ * Converts [x] to a [double] and returns the natural logarithm of the value.
*
* Returns negative infinity if [x] is equal to zero.
* Returns NaN if [x] is NaN or less than zero.
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/math_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698