Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "math/base/special/atan2/docs/types/index.d"

Index

Functions

Functions

Export assignment atan2

  • atan2(y: number, x: number): number
  • Computes the angle in the plane (in radians) between the positive x-axis and the ray from (0,0) to the point (x,y).

    Parameters

    • y: number

      y coordinate

    • x: number

      x coordinate

    Returns number

    angle (in radians)

    Example

    var v = atan2( 2.0, 2.0 ); // => atan(1.0)
    // returns ~0.785

    Example

    var v = atan2( 6.0, 2.0 ); // => atan(3.0)
    // returns ~1.249

    Example

    var v = atan2( -1.0, -1.0 ); // => atan(1.0) - π
    // returns ~-2.356

    Example

    var v = atan2( 3.0, 0.0 ); // => π/2
    // returns ~1.571

    Example

    var v = atan2( -2.0, 0.0 ); // => -π/2
    // returns ~-1.571

    Example

    var v = atan2( 0.0, 0.0 );
    // returns 0.0

    Example

    var v = atan2( 3.0, NaN );
    // returns NaN

    Example

    var v = atan2( NaN, 2.0 );
    // returns NaN