iterator
var uniform = require( `@stdlib/random/iter/uniform` );
var iter = iterAtan2( uniform( -2.0, 2.0 ), uniform( -2.0, 2.0 ) );
var r = iter.next().value;
// returns <number>
r = iter.next().value;
// returns <number>
r = iter.next().value;
// returns <number>
// ...
Returns an iterator which iteratively computes the angle in the plane (in radians) between the positive x-axis and the ray from
(0,0)
to the point(x,y)
.Notes
NaN
), the returned iterator returnsNaN
. If non-numeric iterated values are possible, you are advised to provide an iterator which type checks and handles non-numeric values accordingly.Symbol.iterator
and all provided iterators are iterable, the returned iterator is iterable.