[Chapter 21] Reference: Math.atan2()
Author: David Flanagan
Date: Fri Aug 29 11:17:40 1997

#

| Chapter 21 JavaScript Reference |

# Math.atan2() Function

## Name

Math.atan2() Function---compute the angle from the X axis to a point

## Availability

Navigator 2.0, Internet Explorer 3.0

## Synopsis

    Math.atan2(x, y)

### Arguments

`x`

  The X-coordinate of the point.

`y`

  The Y-coordinate of the point.

### Returns

The counter-clockwise angle, measured in radians, between the positive X axis, and the point (`x`, `y`).

## Description

The `Math.atan2()` function performs half of the conversion between Cartesian coordinates and polar coordinates. It computes and returns the angle theta of an (`x`, `y`) point.

This function is named `Math.atan2()` because it performs a similar computation to `Math.atan()`. `Math.atan2()` is passed separate `x` and `y` arguments, and `Math.atan()` is passed the ratio of those two arguments.

## See Also

"Math", "Math.atan()", "Math.tan()"

Math.atan() |  | Math.ceil()