Latest web development tutorials

JavaScript atan () method

Math Object Reference JavaScript Math Object

Examples

Returns a specified number of arctangent:

Math.atan(2);

Output:

1.1071487177940904

try it"

Definition and Usage

atan () method to value between -PI / 2 and PI / 2 radians to return the arc tangent of x.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support atan () method


grammar

Math.atan( x )

Parameter Value

参数 描述
x 必需。必须是一个数值。

return value

类型 描述
Number x 的反正切值。返回的值是 -PI/2 到 PI/2 之间的弧度值。

technical details

JavaScript version: 1.0


Math Object Reference JavaScript Math Object