Easy Tutorial
❮ Prop Body Link Dom Obj Tableheader ❯

JavaScript tan() Method

JavaScript Math Object

Example

Returns a number representing the tangent of a given angle:

Output result:


Definition and Usage

The tan() method returns a number representing the tangent of a given angle.


Browser Support

All major browsers support the tan() method.


Syntax

Parameter Values

Parameter Description
x Required. An angle in radians. Multiply degrees by 0.017453293 (2PI/360) to convert to radians.

Return Value

Type Description
Number The tangent value of the angle

Technical Details

| JavaScript Version: | 1.0 | | --- | --- |


More Examples

Example

In this example, we will calculate the tangent values of different numbers:

a, b, c, and d Output result:


JavaScript Math Object

❮ Prop Body Link Dom Obj Tableheader ❯