W3cubDocs

/Dart 2

atan2 function

double atan2 (num a, num b)

A variant of atan.

Converts both arguments to doubles.

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).

The result is negative when a is negative (including when a is the double -0.0).

If a is equal to zero, the vector (b,a) is considered parallel to the x-axis, even if b is also equal to zero. The sign of b determines the direction of the vector along the x-axis.

Returns NaN if either argument is NaN.

Implementation

external double atan2(num a, num b);

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.5.0/dart-math/atan2.html