Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

JavaScript atan() method

JavaScript atan() method

Math Object Reference JavaScript Math object

Example

Return the arctangent of the specified number:

Math.atan(2);

Output result:

1.1071487177940904

Try it »


Definition and Usage

The atan() method returns the arctangent of x as a value between -PI/2 and PI/2 radians.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the atan() method.


Syntax

Math.atan(

x

)

Parameter value

Parameters Description
x Required. Must be a numeric value.

Return Value

Type Description
Number The arctangent of x. The returned value is an angle in radians between -PI/2 and PI/2.

Technical Details

JavaScript version: 1.0

Math Object Reference JavaScript Math object