Function idsp::atan2[][src]

pub fn atan2(y: i32, x: i32) -> i32
Expand description

2-argument arctangent function.

This implementation uses all integer arithmetic for fast computation. It is designed to have high accuracy near the axes and lower away from the axes. It is additionally designed so that the error changes slowly with respect to the angle.

Arguments

  • y - Y-axis component.
  • x - X-axis component.

Returns

The angle between the x-axis and the ray to the point (x,y). The result range is from i32::MIN to i32::MAX, where i32::MIN represents -pi and, equivalently, +pi. i32::MAX represents one count less than +pi.