

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get the tangent of a number in JavaScript?
To get the tangent of a number in JavaScript, use the Math.tan() method. This method returns the tangent of a number. The tan method returns a numeric value that represents the tangent of the angle.
Example
You can try to run the following code to get the tangent of a number −
<html> <head> <title>JavaScript Math tan() Method</title> </head> <body> <script> var value = Math.tan( -30 ); document.write("First Value : " + value ); var value = Math.tan( 90 ); document.write("<br />Second Value : " + value ); var value = Math.tan( 45 ); document.write("<br />Third Value : " + value ); var value = Math.tan( Math.PI/180 ); document.write("<br />Fourth Value : " + value ); </script> </body> </html>
- Related Questions & Answers
- Get the hyperbolic tangent of a given value in Java
- Get the arc tangent of a given value in Java
- How to get the length of a Number in JavaScript?
- How to get the cosine of a number in JavaScript?
- How to get the sine of a number in JavaScript?
- Get the Trigonometric tangent of an angle in Python
- Get the Trigonometric inverse tangent in Python
- How to get the absolute value of a number in JavaScript?
- How to get the square root of a number in JavaScript?
- How to get the exponent power of a number in JavaScript?
- Get the Trigonometric inverse tangent of the array elements in Python
- How to get the arccosine (in radians) of a number in JavaScript?
- How to get the arcsine (in radians) of a number in JavaScript?
- How to get the arctangent (in radians) of a number in JavaScript?
- How to get the number of forms in a document with JavaScript?
Advertisements