atan (JavaScript)

Gets the inverse tangent of an angle.

Defined in

Math (JavaScript)

Syntax

atan(value:double) : double
Parameter Description
value The tangent of an angle; that is, the ratio of the adjacent side to the opposite side. See below for special cases.
Return value Description
double The inverse tangent of the parameter in radians. See rad (JavaScript) to convert degrees to radians.

Usage

Special cases are as follows:
  • The inverse tangent of NaN is NaN.
  • The inverse tangent of +0 is positive zero.
  • The inverse tangent of -0 is negative zero.

Examples

This button onclick event calculates an angle in degrees of a right triangle given the length of the adjacent side and the length of the opposite side.
sessionScope.angleA = 
	Math.deg(Math.atan(sessionScope.a / sessionScope.b))