THE WORLD'S LARGEST WEB DEVELOPER SITE

JavaScript tan() Method

❮ JavaScript Math Object

Example

Return the tangent of a number (angle):

Math.tan(90);
Try it Yourself »

More "Try it Yourself" examples below.


Definition and Usage

The tan() method returns a number that represents the tangent of an angle.


Browser Support

Method
tan() Yes Yes Yes Yes Yes

Syntax

Math.tan(x)

Parameter Values

Parameter Description
x Required. A number representing an angle (in radians)


Technical Details

Return Value: A Number, representing the tangent of an angle
JavaScript Version: ECMAScript 1

More Examples

Example

Return the tangent of different angles:

var a = Math.tan(90);
var b = Math.tan(-90);
var c = Math.tan(45);
var d = Math.tan(60);
Try it Yourself »

❮ JavaScript Math Object