Dart SDK
dart:math
library
dart:math
Constants
Functions
Classes
Constants
E
LN10
LN2
LOG2E
LOG10E
PI
SQRT1_2
SQRT2
Functions
min
max
atan2
pow
sin
cos
tan
acos
asin
atan
sqrt
exp
log
Classes
Point
Random
Rectangle
MutableRectangle
Mathematical constants and functions, plus a random number generator.
Constants
double
E
=
2.718281828459045
const
Base of the natural logarithms.
double
LN10
=
2.302585092994046
const
Natural logarithm of 10.
double
LN2
=
0.6931471805599453
const
Natural logarithm of 2.
double
LOG2E
=
1.4426950408889634
const
Base-2 logarithm of E.
double
LOG10E
=
0.4342944819032518
const
Base-10 logarithm of E.
double
PI
=
3.1415926535897932
const
The PI constant.
double
SQRT1_2
=
0.7071067811865476
const
Square root of 1/2.
double
SQRT2
=
1.4142135623730951
const
Square root of 2.
Functions
min
(
num
a
,
num
b
) →
num
Returns the lesser of two numbers.
max
(
num
a
,
num
b
) →
num
Returns the larger of two numbers.
atan2
(
num
a
,
num
b
) →
double
A variant of
atan
.
pow
(
num
x
,
num
exponent
) →
num
Returns x to the power of exponent.
sin
(
num
x
) →
double
Converts x to a double and returns the sine of the value.
cos
(
num
x
) →
double
Converts x to a double and returns the cosine of the value.
tan
(
num
x
) →
double
Converts x to a double and returns the tangent of the value.
acos
(
num
x
) →
double
Converts x to a double and returns the arc cosine of the value.
asin
(
num
x
) →
double
Converts x to a double and returns the arc sine of the value.
atan
(
num
x
) →
double
Converts x to a dobule and returns the arc tangent of the value.
sqrt
(
num
x
) →
double
Converts x to a double and returns the positive square root of the value.
exp
(
num
x
) →
double
Converts x to a double and returns the natural exponent, E, to the power x.
log
(
num
x
) →
double
Converts x to a double and returns the natural logarithm of the value.
Classes
Point
A utility class for representing two-dimensional positions.
Random
A generator of random bool, int, or double values.
Rectangle
A class for representing two-dimensional rectangles whose properties are immutable.
MutableRectangle
A class for representing two-dimensional axis-aligned rectangles with mutable properties.