X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

JavaScript tan() Method

Math Object Reference JavaScript Math Object

Example

Return the tangent of a number (angle):

Math.tan(90);

The result will be:

-1.995200412208242

Try it yourself »


Definition and Usage

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


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The tan() method is supported in all major browsers.


Syntax

Math.tan(x)

Parameter Values

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

Return Value

Type Description
Number The tangent of an angle

Technical Details

JavaScript Version: 1.0


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);

The result of a,b,c, and d will be:

-1.995200412208242
1.995200412208242
1.6197751905438615
0.320040389379563

Try it yourself »


Math Object Reference JavaScript Math Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook