
- 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
Get the hyperbolic tangent of a given value in Java
In order to get the hyperbolic tangent of a given value in Java, we use the java.lang.Math.tanh() method. The tanh() method accepts an argument in radians and returns the hyperbolic tan of the argument which acts as the angle.
Declaration −The java.lang.Math.tanh() is declared as follows −
public static double tanh(double x)
where, x is the angle in radians.
Let us see a program to get the hyperbolic tangent of a given value in Java.
Example
import java.lang.Math; public class Example { public static void main(String[] args) { // get two double numbers in degrees double x = 90; double y = 180; // convert them in radians x = Math.toRadians(x); y = Math.toRadians(y); // computing and displaying the hyperbolic tangent of these doubles System.out.println("Hyperbolic tangent of " + x + " = " + Math.tanh(x)); System.out.println("Hyperbolic tangent of " + y + " = " + Math.tanh(y)); } }
Output
Hyperbolic tangent of 1.5707963267948966 = 0.9171523356672744 Hyperbolic tangent of 3.141592653589793 = 0.99627207622075
- Related Questions & Answers
- Get the arc tangent of a given value in Java
- Get the hyperbolic cosine of a given value in Java
- Get the hyperbolic sine of a given value in Java
- Compute the Hyperbolic tangent in Python
- Compute the inverse Hyperbolic tangent in Python
- Compute the Hyperbolic tangent of the array elements in Python
- Compute the inverse Hyperbolic tangent of array elements in Python
- Compute the inverse hyperbolic tangent with scimath in Python
- Get the hyperbolic arc-cosine of a floating-point value in C#
- Get the Trigonometric tangent of an array of angles given in degrees with Python
- How to get the tangent of a number in JavaScript?
- Get the Trigonometric tangent of an angle in Python
- Get the Trigonometric inverse tangent in Python
- Get the value associated with a given key in Java HashMap
- Get the Trigonometric inverse tangent of the array elements in Python
Advertisements