atan2()

Scalar. Returns the arctangent of the quotient of two given values.

Syntax

atan2 ( value1, value2 )

Parameters

value1

A float.

value2

A float.

Usage

Returns the arctangent of the quotient of the given values, within the range of the standard arctangent function:
  • If value2 > 0, then atan2 (value1, value2) returns the value of atan (value1/value2).
  • If value1 >= 0 and value2 < 0, then atan2 (value1, value2) returns the value of atan (value1/value2) + pi().
  • If value1 < 0 and value2 < 0, then atan2 (value1, value2) returns the value of atan (value1/value2) - pi().
  • If value1 > 0 and value2 = 0, then atan2 (value1, value2) returns the value of pi()/2.
  • If value1 < 0 and value2 = 0, then atan2 (value1, value2) returns the value of -pi()/2.
  • If value1 = value2 = 0, then atan2 (value1, value2) returns 0.

Example

atan2 ( 1, 2) returns 0.463647609, the value of atan (0.5).