# Arc Tangent Function 2

## Summary

Given the and coordinates of a point, returns the angle associated with the point in radians. If the point’s -coordinate is negative, meaning that the point is in quadrant or , the function returns a negative angle.

atan2(y,x)

### Arguments

Name Description
y A number representing the vertical component of a point in the Cartesian Plane
x A number representing the horizontal component of a point in the Cartesian Plane

## Usage

The improved arctangent function, which takes in a and coordinate as input, returns the angle associated with the point . For example, given the point as input the function returns the angle of as illustrated by figure 1.

= atan2(1,1) = 0.785... // (1/8)*TAU

### ATAN2 vs. ATAN

Many programming languages provide both the ATAN2 function and the ATAN function. The difference between the two functions is the range of possible return values for real number input. The range of is while the range of is . In other words, the ATAN function returns angles on the right-half of the circle and ATAN2 returns angles on the whole circle.

Input Behavior