Definition and Usage The tan() method returns a number that represents the tangent of an angle. Syntax Math.tan(x) Parameter...

## Definition and Usage

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

## Syntax

Parameter | Description |

x | Required. A number |

## Example

In this example we will get the tangent of different numbers:

<script type="text/javascript"> document.write(Math.tan(0.50) + "<br />");
document.write(Math.tan(-0.50) + "<br />");
document.write(Math.tan(5) + "<br />");
document.write(Math.tan(10) + "<br />");
document.write(Math.tan(-5) + "<br />");
document.write(Math.tan(-10)); </script> |

The output of the code above will be:

0.5463024898437905
-0.5463024898437905
-3.380515006246586
0.6483608274590866
3.380515006246586
-0.6483608274590866 |