JavaScript tan() method

Definition and usage

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

Instance

Example 1

Returns the tangent of the number (angle):

Math.tan(90);

Try it yourself

Example 2

Returns the tangent values 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

Syntax

Math.tan(x)

Parameter value

Parameter Description
x

Required. Number. Represents the angle (in radians).

Convert the angle by multiplying it with 0.017453293 (2PI/360) to convert it to radians.

Τεχνικά Στοιχεία

Αποτελεσματική τιμή: Αριθμητική, που δείχνει το tangent του γωνιακού
Έκδοση JavaScript: ECMAScript 1

Υποστήριξη Browser

Μέθοδος Chrome IE Firefox Safari Opera
tan() Υποστήριξη Υποστήριξη Υποστήριξη Υποστήριξη Υποστήριξη

Σελίδες Σχετικές

Εκμάθηση:Μαθηματικά JavaScript