Angle.atan2 constructor

Angle.atan2(
  1. double y,
  2. double x
)

Create an angle by computing the arc tangent from y / x. This uses the atan2() function, therefore there are two separate parameters for the nominator and the denominator. The result is an angle in ]-180°;180°]. Sample values:

  • y=0, x=0 => 0°
  • y=0, x=1 => 0°
  • y=1, x=0 => 90°
  • y=0, x=-1 => 180°
  • y=-1, x=0 => -90°

Implementation

Angle.atan2(final double y, final double x) : _storage = math.atan2(y, x);