dart:math library
Mathematical constants and functions, plus a random number generator.
To use this library in your code:
import 'dart:math';
Classes
- MutableRectangle<T extends num>
- A class for representing two-dimensional axis-aligned rectangles with mutable properties.
- Point<T extends num>
- A utility class for representing two-dimensional positions.
- Random
- A generator of random bool, int, or double values. [...]
- Rectangle<T extends num>
- A class for representing two-dimensional rectangles whose properties are immutable.
Constants
- E → const double
-
Deprecated, use
einstead.e - e → const double
-
Base of the natural logarithms. [...]
2.718281828459045 - LN2 → const double
-
Deprecated, use
ln2instead.ln2 - ln2 → const double
-
Natural logarithm of 2. [...]
0.6931471805599453 - LN10 → const double
-
Deprecated, use
ln10instead.ln10 - ln10 → const double
-
Natural logarithm of 10. [...]
2.302585092994046 - LOG2E → const double
-
Deprecated, use
log2einstead.log2e - log2e → const double
-
Base-2 logarithm of
e.1.4426950408889634 - LOG10E → const double
-
Deprecated, use
log10einstead.log10e - log10e → const double
-
Base-10 logarithm of
e.0.4342944819032518 - PI → const double
-
Deprecated, use
piinstead.pi - pi → const double
-
The PI constant.
3.1415926535897932 - SQRT1_2 → const double
-
Deprecated, use
sqrt1_2instead.sqrt1_2 - sqrt1_2 → const double
-
Square root of 1/2.
0.7071067811865476 - SQRT2 → const double
-
Deprecated, use
sqrt2instead.sqrt2 - sqrt2 → const double
-
Square root of 2.
1.4142135623730951
Functions
-
acos(
num x) → double -
Converts
xto a double and returns its arc cosine in radians. [...] -
asin(
num x) → double -
Converts
xto a double and returns its arc sine in radians. [...] -
atan(
num x) → double -
Converts
xto a double and returns its arc tangent in radians. [...] -
atan2(
num a, num b) → double - A variant of atan. [...]
-
cos(
num radians) → double -
Converts
radiansto a double and returns the cosine of the value. [...] -
exp(
num x) → double -
Converts
xto a double and returns the natural exponent, e, to the powerx. [...] -
log(
num x) → double -
Converts
xto a double and returns the natural logarithm of the value. [...] -
max<T extends num>(
T a, T b) → T - Returns the larger of two numbers. [...]
-
min<T extends num>(
T a, T b) → T - Returns the lesser of two numbers. [...]
-
pow(
num x, num exponent) → num -
Returns
xto the power ofexponent. [...] -
sin(
num radians) → double -
Converts
radiansto a double and returns the sine of the value. [...] -
sqrt(
num x) → double -
Converts
xto a double and returns the positive square root of the value. [...] -
tan(
num radians) → double -
Converts
radiansto a double and returns the tangent of the value. [...]