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)
```

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 |

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
```

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 |
---|---|

Quadrant 1 | Same |

Quadrant 2 | Different |

Quadrant 3 | Different |

Quadrant 4 | Same |

The reason why both functions exist has to do with the complex number system. When using complex number input with `ATAN`

the function returns angles in all coordinates. The difference is that `ATAN2`

expects the horizontal and vertical components as separate values and `ATAN`

expects complex number input which has the two different components stored within one number.

So if you are not using the complex number system, this is the function to use in most cases. Otherwise, the other arc functions will work well with the complex number system.

Given a number representing the the ratio of a right triangle's opposite side over its adjecent side returns the corresponding angle.

A complex number is an extension of the real number line where in addition to the "real" part of the number there is a complex part of the number. The properties of complex numbers are useful in applied physics as they elegantly describe rotation.