JavaScript tan() method
- Previous Page SQRT2
- Next Page tanh()
- Go to the Previous Level JavaScript Math Reference Manual
Definition and usage
tan()
The method returns a number representing the tangent of the angle.
Instance
Example 1
Returns the tangent of a number (angle):
Math.tan(90);
Example 2
Returns 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);
Syntax
Math.tan(x)
Parameter value
Parameter | Description |
---|---|
x |
Required. Number. Represents the angle (in radians). Multiplying the angle by 0.017453293 (2PI/360) converts it to radians. |
Technical Details
Return Value: | A number representing the tangent of an angle |
---|---|
JavaScript Version: | ECMAScript 1 |
Browser Support
Method | Chrome | IE | Firefox | Safari | Opera |
---|---|---|---|---|---|
tan() | Support | Support | Support | Support | Support |
Related Pages
Tutorial:JavaScript Mathematics
- Previous Page SQRT2
- Next Page tanh()
- Go to the Previous Level JavaScript Math Reference Manual