Math Function
Math Function
import 'dart:math';
Trigonometric Functions
• sin(num x): Returns the sine of x (x is in 4. Random Number Generation
radians). • Random: A class to generate random numbers. You can
• cos(num x): Returns the cosine of x (x is in create an instance of Random and use its methods:
radians). • nextInt(int max): Returns a random integer from
• tan(num x): Returns the tangent of x (x is in 0 (inclusive) to max (exclusive).
radians). • nextDouble(): Returns a random double between
• asin(num x): Returns the arc sine of x in 0.0 (inclusive) and 1.0 (exclusive).
radians. • nextBool(): Returns a random boolean value.
• acos(num x): Returns the arc cosine of x in
radians.
• atan(num x): Returns the arc tangent of x in
radians.
• atan2(num y, num x): Returns the angle (in
radians) between the positive x-axis and the
point (x, y).
Dart Page 1